]> sjero.net Git - linphone/commitdiff
Add pbuf nullity checks
authorYann Diorcet <yann.diorcet@belledonne-communications.com>
Mon, 15 Oct 2012 15:13:11 +0000 (17:13 +0200)
committerYann Diorcet <yann.diorcet@belledonne-communications.com>
Mon, 15 Oct 2012 15:13:11 +0000 (17:13 +0200)
gtk/main.c

index 1938032563aad51cb1ca011251802f40ac2b285c..b773a5b7faed3b92e8bb2a608b1832bb46c9e119 100644 (file)
@@ -279,8 +279,10 @@ static void linphone_gtk_configure_window(GtkWidget *w, const char *window_name)
                linphone_gtk_visibility_set(shown,window_name,w,TRUE);
        if (icon_path) {
                GdkPixbuf *pbuf=create_pixbuf(icon_path);
-               gtk_window_set_icon(GTK_WINDOW(w),pbuf);
-               g_object_unref(G_OBJECT(pbuf));
+               if(pbuf != NULL) {
+                       gtk_window_set_icon(GTK_WINDOW(w),pbuf);
+                       g_object_unref(G_OBJECT(pbuf));
+               }
        }
 }
 
@@ -1526,8 +1528,10 @@ static void linphone_gtk_configure_main_window(){
        }
        if (search_icon){
                GdkPixbuf *pbuf=create_pixbuf(search_icon);
-               gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"directory_search_button_icon")),pbuf);
-               g_object_unref(G_OBJECT(pbuf));
+               if(pbuf != NULL) {
+                       gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"directory_search_button_icon")),pbuf);
+                       g_object_unref(G_OBJECT(pbuf));
+               }
        }
        if (home){
                gchar *tmp;