diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2015-02-13 19:03:04 +0100 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2015-02-16 13:11:32 -0600 |
commit | e822acf8a4f70a5ca848a9caaf635e3ee1cb6ba4 (patch) | |
tree | 5225499e37cc1a0ca06453b83139ebf70e79885e | |
parent | 899f5a4768385860e6cd88d965aebc515d498b87 (diff) | |
download | network-manager-applet-e822acf8a4f70a5ca848a9caaf635e3ee1cb6ba4.tar.gz |
mobile-helpers: don't try to add access tech icon if unknown
If we cannot get an icon name to use based on the access tech, don't segfault.
Instead, just ignore the access tech icon.
Program received signal SIGSEGV, Segmentation fault.
0xb6ffb07a in g_str_hash () from /usr/lib/libglib-2.0.so.0
(gdb) bt full
#0 0xb6ffb07a in g_str_hash () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#1 0xb6ffa4a8 in g_hash_table_lookup () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#2 0x0805dfef in nma_icon_check_and_load ()
No symbol table info available.
#3 0x0806e778 in mobile_helper_get_status_pixbuf ()
No symbol table info available.
#4 0x0806f042 in mobile_helper_get_icon ()
No symbol table info available.
#5 0x080724d2 in ?? ()
No symbol table info available.
#6 0x0805e80a in ?? ()
No symbol table info available.
#7 0xb7008130 in ?? () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#8 0xb700b8d3 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#9 0xb700bce9 in ?? () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#10 0xb700c099 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#11 0x08056654 in main ()
https://bugs.archlinux.org/task/43576
https://bugzilla.gnome.org/show_bug.cgi?id=744421
-rw-r--r-- | src/mobile-helpers.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/mobile-helpers.c b/src/mobile-helpers.c index 9cfb5fe0..4da1d97a 100644 --- a/src/mobile-helpers.c +++ b/src/mobile-helpers.c @@ -78,13 +78,20 @@ mobile_helper_get_status_pixbuf (guint32 quality, 0, 0, 1.0, 1.0, GDK_INTERP_BILINEAR, 255); } else { - tmp = nma_icon_check_and_load (mobile_helper_get_tech_icon_name (access_tech), applet); - if (tmp) { - gdk_pixbuf_composite (tmp, pixbuf, 0, 0, - gdk_pixbuf_get_width (tmp), - gdk_pixbuf_get_height (tmp), - 0, 0, 1.0, 1.0, - GDK_INTERP_BILINEAR, 255); + const gchar *tech_icon_name; + + /* Only try to add the access tech info icon if we get a valid + * access tech reported. */ + tech_icon_name = mobile_helper_get_tech_icon_name (access_tech); + if (tech_icon_name) { + tmp = nma_icon_check_and_load (tech_icon_name, applet); + if (tmp) { + gdk_pixbuf_composite (tmp, pixbuf, 0, 0, + gdk_pixbuf_get_width (tmp), + gdk_pixbuf_get_height (tmp), + 0, 0, 1.0, 1.0, + GDK_INTERP_BILINEAR, 255); + } } } |