[gnome-builder] flatpak: check for valid command node



commit 458eb5b1e5818dfbdd17174963dbd79b6002819d
Author: Christian Hergert <chergert redhat com>
Date:   Sat Nov 25 13:49:05 2017 -0800

    flatpak: check for valid command node
    
    If we get a NULL command node, we probably found a supplemental manifest
    providing modules rather than the primary manifest.

 src/plugins/flatpak/gbp-flatpak-configuration.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-configuration.c b/src/plugins/flatpak/gbp-flatpak-configuration.c
index ee05325..6565da0 100644
--- a/src/plugins/flatpak/gbp-flatpak-configuration.c
+++ b/src/plugins/flatpak/gbp-flatpak-configuration.c
@@ -363,9 +363,15 @@ gbp_flatpak_configuration_load_from_file (GbpFlatpakConfiguration *self,
   sdk = json_node_get_string (sdk_node);
   gbp_flatpak_configuration_set_sdk (self, sdk);
 
+  /* Get the command to run for this manifest. If this is missing, then
+   * we likely have a situation where this is a supplemental manifest
+   * and not the primary manifest.
+   */
   command_node = json_object_get_member (root_object, "command");
-  if (JSON_NODE_HOLDS_VALUE (command_node))
-    gbp_flatpak_configuration_set_command (self, json_node_get_string (command_node));
+  if (command_node == NULL || !JSON_NODE_HOLDS_VALUE (command_node))
+    return FALSE;
+
+  gbp_flatpak_configuration_set_command (self, json_node_get_string (command_node));
 
   if (json_object_has_member (root_object, "finish-args"))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]