From fd45ec178fd8f114a2c7ef334cf88a23f4fc0436 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 6 Jan 2017 13:19:33 +0000 Subject: Fix a crash when using as_release_get_location_default() The locations array is now lazy-loaded. --- libappstream-glib/as-release.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libappstream-glib/as-release.c b/libappstream-glib/as-release.c index 72c81ff..ce756a5 100644 --- a/libappstream-glib/as-release.c +++ b/libappstream-glib/as-release.c @@ -355,6 +355,8 @@ const gchar * as_release_get_location_default (AsRelease *release) { AsReleasePrivate *priv = GET_PRIVATE (release); + if (priv->locations == NULL) + return NULL; if (priv->locations->len == 0) return NULL; return g_ptr_array_index (priv->locations, 0); -- cgit v1.2.1