summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-02-29 12:35:46 +0100
committerThomas Haller <thaller@redhat.com>2016-02-29 12:35:48 +0100
commite1075eee971082a371ecc21893e5a365bf34e41d (patch)
tree46f95108a47855ba79049aea9ab586a793e06e69
parent1f960792f98a6e587905a43da2815ecd634502b8 (diff)
downloadnetwork-manager-applet-th/applet-icon-crash-bgo762421.tar.gz
applet: avoid setting negative icon-size for appletth/applet-icon-crash-bgo762421
Seems we can hit (nm-applet:4985): nm-applet-CRITICAL **: nma_icons_reload: assertion 'applet->isize > 0' failed which can only happen if the icon-size reported by "size-changed" is negative. Avoid that.
-rw-r--r--src/applet.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/applet.c b/src/applet.c
index f2578ce8..7ba77448 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -3048,7 +3048,12 @@ status_icon_size_changed_cb (GtkStatusIcon *icon,
/* icon_size may be 0 if for example the panel hasn't given us any space
* yet. We'll get resized later, but for now just load the 16x16 icons.
*/
- applet->icon_size = size ? size : 16;
+ if (size > 0)
+ applet->icon_size = size;
+ else {
+ applet->icon_size = 16;
+ g_warn_if_fail (size == 0);
+ }
nma_icons_reload (applet, NULL);