diff options
author | William Hua <william.hua@canonical.com> | 2013-06-22 12:00:34 -0400 |
---|---|---|
committer | William Hua <william.hua@canonical.com> | 2013-06-22 12:00:34 -0400 |
commit | 3dd243d0e4bcf2fbcc263d47ce8f9dead6a070f6 (patch) | |
tree | f375ac1832fb89256c0464be5b6085ac943627af /lib | |
parent | b4660d9b7e22bbcebac465b67edb5e1bfee1308e (diff) | |
download | ayatana-indicator-keyboard-3dd243d0e4bcf2fbcc263d47ce8f9dead6a070f6.tar.gz ayatana-indicator-keyboard-3dd243d0e4bcf2fbcc263d47ce8f9dead6a070f6.tar.bz2 ayatana-indicator-keyboard-3dd243d0e4bcf2fbcc263d47ce8f9dead6a070f6.zip |
Don't set menu item if null.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.am | 2 | ||||
-rw-r--r-- | lib/main.vala | 7 |
2 files changed, 7 insertions, 2 deletions
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 { |