[gnome-builder/wip/chergert/static-link: 1/2] beautifier: fix	occasional warning at startup
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-builder/wip/chergert/static-link: 1/2] beautifier: fix	occasional warning at startup
- Date: Sat, 23 Sep 2017 00:34:26 +0000 (UTC)
commit 8d5f31ffbfceeee01e65d8e4a2b656f1828d5f11
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 22 17:32:56 2017 -0700
    beautifier: fix occasional warning at startup
    
    This appears to be racey, and after statically linking things in, it was
    more likely to appear.
 .../beautifier/gb-beautifier-editor-addin.c        |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/beautifier/gb-beautifier-editor-addin.c 
b/src/plugins/beautifier/gb-beautifier-editor-addin.c
index 2b5c302..65b571b 100644
--- a/src/plugins/beautifier/gb-beautifier-editor-addin.c
+++ b/src/plugins/beautifier/gb-beautifier-editor-addin.c
@@ -123,12 +123,15 @@ static void
 set_default_keybinding (GbBeautifierEditorAddin *self,
                         const gchar             *action_name)
 {
+  static const gchar *accel = "<primary><Alt>b";
   DzlShortcutController *controller;
-  gchar *accel = "<primary><Alt>b";
 
   g_assert (GB_IS_BEAUTIFIER_EDITOR_ADDIN (self));
   g_assert (action_name != NULL);
 
+  if (self->current_view == NULL)
+    return;
+
   controller = dzl_shortcut_controller_find (GTK_WIDGET (self->current_view));
   dzl_shortcut_controller_add_command_action (controller,
                                               "org.gnome.builder.editor-view.beautifier-default",
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]