summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2020-11-02 21:59:00 +0100
committerNiels De Graef <nielsdegraef@gmail.com>2020-11-02 22:00:35 +0100
commit46d8b5948068a4a42f94a55e2cab5164732dc216 (patch)
tree8c6265684b527f7ae8a490750ba5e1fb044447c5
parent8194ddc27e53be2e8806d1c2ccb4bc3d98de0ac9 (diff)
downloadgnome-contacts-wip/nielsdg/fix-critical-on-new.tar.gz
fakepersona: Watch out casting a GValuewip/nielsdg/fix-critical-on-new
Fixes https://gitlab.gnome.org/GNOME/gnome-contacts/-/issues/188
-rw-r--r--src/contacts-fake-persona-store.vala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/contacts-fake-persona-store.vala b/src/contacts-fake-persona-store.vala
index ca6836b..7a5d458 100644
--- a/src/contacts-fake-persona-store.vala
+++ b/src/contacts-fake-persona-store.vala
@@ -106,7 +106,9 @@ PostalAddressDetails
public LoadableIcon? avatar {
get {
unowned Value? value = this.properties.get ("avatar");
- return (LoadableIcon?) value;
+ // Casting a Value internally makes it use g_value_get_object(),
+ // which is of course not allowed for a NULL value
+ return (value != null)? (LoadableIcon?) value : null;
}
set {
this.properties.set ("avatar", value);