Permalink
Browse files

Don't throw assertion errors when some icons can't be found

Don't throw assertion errors (and a possible crash) when
some icons can't be found. Fixes RHBZ #654826

Patch by Erik van Pienbroek
http://pkgs.fedoraproject.org/cgit/mail-notification.git/commit/?id=049a5ab09d9717a92c1f0993e8e02619f052c974
  • Loading branch information...
1 parent fa576da commit 220a6a23774945180a2052ee9d99ff133a42e0e0 @epienbroek committed Aug 20, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/mn-stock.c
View
7 src/mn-stock.c
@@ -86,6 +86,13 @@ mn_stock_init (void)
gtk_icon_source_set_icon_name(icon_source, icons[i].icon_name);
gtk_icon_set_add_source(icon_set, icon_source);
gtk_icon_source_free(icon_source);
+
+ /* Add a fallback icon */
+ icon_source = gtk_icon_source_new();
+ gtk_icon_source_set_icon_name(icon_source, "mail-notification");
+ gtk_icon_source_set_state_wildcarded(icon_source, TRUE);
+ gtk_icon_set_add_source(icon_set, icon_source);
+ gtk_icon_source_free(icon_source);
}
else if (icons[i].source_stock_id)
{

0 comments on commit 220a6a2

Please sign in to comment.