text: Don't crash when somebody drops NULL
authorBenjamin Otte <otte@redhat.com>
Tue, 7 Mar 2023 03:45:35 +0000 (04:45 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 8 Mar 2023 01:16:59 +0000 (20:16 -0500)
gtk/gtktext.c

index 9d11aa2d2adff1ee74213f4ba76d5ed494492103..53335ced0535818a9812f316e79127249372dbae 100644 (file)
@@ -6354,6 +6354,9 @@ gtk_text_drag_drop (GtkDropTarget *dest,
   drop_position = gtk_text_find_position (self, x + priv->scroll_offset);
 
   str = g_value_get_string (value);
+  if (str == NULL)
+    str = "";
+
   if (priv->truncate_multiline)
     length = truncate_multiline (str);
   else