[gnome-software] Don't crash when the moduleset data is not yet installed
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Don't crash when the moduleset data is not yet installed
- Date: Fri, 10 Oct 2014 16:23:20 +0000 (UTC)
commit 201810074dd46eafd88d2dbd01c94a9d6e59a737
Author: Richard Hughes <richard hughsie com>
Date: Fri Oct 10 16:06:16 2014 +0100
Don't crash when the moduleset data is not yet installed
This happens if you've done 'make install' in src/ but not in data/...
src/plugins/gs-plugin-moduleset.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-moduleset.c b/src/plugins/gs-plugin-moduleset.c
index 2b9581c..014518c 100644
--- a/src/plugins/gs-plugin-moduleset.c
+++ b/src/plugins/gs-plugin-moduleset.c
@@ -127,6 +127,14 @@ gs_plugin_add_popular (GsPlugin *plugin,
"popular",
category);
}
+ if (apps == NULL) {
+ ret = FALSE;
+ g_set_error (error,
+ GS_PLUGIN_ERROR,
+ GS_PLUGIN_ERROR_FAILED,
+ "No moduleset data found");
+ goto out;
+ }
/* just add all */
for (i = 0; apps[i]; i++) {
@@ -179,6 +187,14 @@ gs_plugin_refine (GsPlugin *plugin,
}
}
}
+ if (apps == NULL) {
+ ret = FALSE;
+ g_set_error (error,
+ GS_PLUGIN_ERROR,
+ GS_PLUGIN_ERROR_FAILED,
+ "No moduleset data found");
+ goto out;
+ }
/* just mark each one as core */
pkgs = gs_moduleset_get_modules (plugin->priv->moduleset,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]