[gtk/picture-nullable-setters] picture: Make setters actually take NULL
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/picture-nullable-setters] picture: Make setters actually take NULL
- Date: Wed, 26 May 2021 11:31:15 +0000 (UTC)
commit 8f4b0cd30dbcae5ac9d525055fa9c5b2655fbe07
Author: Matthias Clasen <mclasen redhat com>
Date: Wed May 26 07:30:09 2021 -0400
picture: Make setters actually take NULL
gtk_picture_set_file was claiming to be nullable,
but choked on NULL.
Fixes: #3974
gtk/gtkpicture.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkpicture.c b/gtk/gtkpicture.c
index c6f82be0c0..194d2fc98a 100644
--- a/gtk/gtkpicture.c
+++ b/gtk/gtkpicture.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]