aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2013-06-22 12:00:34 -0400
committerWilliam Hua <william.hua@canonical.com>2013-06-22 12:00:34 -0400
commit3dd243d0e4bcf2fbcc263d47ce8f9dead6a070f6 (patch)
treef375ac1832fb89256c0464be5b6085ac943627af
parentb4660d9b7e22bbcebac465b67edb5e1bfee1308e (diff)
downloadayatana-indicator-keyboard-3dd243d0e4bcf2fbcc263d47ce8f9dead6a070f6.tar.gz
ayatana-indicator-keyboard-3dd243d0e4bcf2fbcc263d47ce8f9dead6a070f6.tar.bz2
ayatana-indicator-keyboard-3dd243d0e4bcf2fbcc263d47ce8f9dead6a070f6.zip
Don't set menu item if null.
-rw-r--r--data/Makefile.am2
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/main.vala7
3 files changed, 8 insertions, 3 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index f9720a95..61be4ab1 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,4 +1,4 @@
-AM_CFLAGS = -DGNOME_DESKTOP_USE_UNSTABLE_API
+AM_CFLAGS = -w -DGNOME_DESKTOP_USE_UNSTABLE_API
AM_LDFLAGS = -lm
AM_VALAFLAGS = --enable-experimental-non-null \
--metadatadir $(top_srcdir)/deps \
diff --git a/lib/Makefile.am b/lib/Makefile.am
index a8486211..1d88add2 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,4 +1,4 @@
-AM_CFLAGS = -DGNOME_DESKTOP_USE_UNSTABLE_API
+AM_CFLAGS = -w -DGNOME_DESKTOP_USE_UNSTABLE_API
AM_LDFLAGS = -lm
AM_VALAFLAGS = --enable-experimental-non-null \
--metadatadir $(top_srcdir)/deps \
diff --git a/lib/main.vala b/lib/main.vala
index 2081414e..30d186cc 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -591,7 +591,12 @@ public class Indicator.Keyboard.Service : Object {
var menu_item = new MenuItem (name, "indicator.current");
menu_item.set_attribute (Menu.ATTRIBUTE_TARGET, "u", i);
- menu_item.set_icon ((!) get_icon (i));
+
+ var icon = get_icon (i);
+ if (icon != null) {
+ menu_item.set_icon ((!) icon);
+ }
+
menu.append_item (menu_item);
}
} else {