picture: Make setters actually take NULL

gtk_picture_set_file was claiming to be nullable,
but choked on NULL.

Fixes: #3974
This commit is contained in:
Matthias Clasen 2021-05-26 07:30:09 -04:00
parent cbe2aa716d
commit 8f4b0cd30d

View File

@ -586,7 +586,11 @@ gtk_picture_set_file (GtkPicture *self,
g_set_object (&self->file, file);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_FILE]);
paintable = gdk_paintable_new_from_file_scaled (file, gtk_widget_get_scale_factor (GTK_WIDGET (self)));
if (file)
paintable = gdk_paintable_new_from_file_scaled (file, gtk_widget_get_scale_factor (GTK_WIDGET (self)));
else
paintable = NULL;
gtk_picture_set_paintable (self, paintable);
g_clear_object (&paintable);