Do a basic check for widget validity in CLAWS_SET_TIP().
authorAndrej Kacian <ticho@claws-mail.org>
Wed, 24 Aug 2016 11:39:33 +0000 (13:39 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Wed, 24 Aug 2016 11:58:08 +0000 (13:58 +0200)
Inspired by patch in bug #3678.

src/gtk/gtkutils.h

index 7510387..568e334 100644 (file)
@@ -202,11 +202,13 @@ claws_input_add    (gint        source,
                    gpointer          data,
                    gboolean          is_sock);
 
-#define CLAWS_SET_TIP(widget,tip) {                                    \
-       if (tip != NULL)                                                \
-               gtk_widget_set_tooltip_text(GTK_WIDGET(widget), tip);   \
-       else                                                            \
-               gtk_widget_set_has_tooltip(GTK_WIDGET(widget), FALSE);  \
+#define CLAWS_SET_TIP(widget,tip) {                                            \
+       if (widget != NULL) {                                                   \
+               if (tip != NULL)                                                \
+                       gtk_widget_set_tooltip_text(GTK_WIDGET(widget), tip);   \
+               else                                                            \
+                       gtk_widget_set_has_tooltip(GTK_WIDGET(widget), FALSE);  \
+       }                                                                       \
 }
 
 #if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))