Merge "Added tools - mockup of cloud and injector. Changed code to support task-worker." master
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 29 Aug 2018 08:09:12 +0000 (08:09 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 29 Aug 2018 08:09:12 +0000 (08:09 +0000)
1  2 
daemon/src/ttd-parse-cmd.c

@@@ -255,16 -271,10 +273,16 @@@ int ttd_parse_json_to_cmd(const char *j
                return -1;
        }
  
 -      items_obj = json_object_object_get(root_obj, TTD_CMD_KEY_ITEMS);
 +      json_object_object_get_ex(root_obj, TTD_CMD_KEY_ITEMS, &items_obj);
 +      if (!items_obj) {
 +              _E("There are no cmd items");
 +              json_object_put(root_obj);
 +              return -1;
 +      }
 +
        items_type = json_object_get_type(items_obj);
        if (items_type != json_type_array) {
-               _E("cmd items are not array type");
+               _E("cmd items are not array type (is %d)", items_type);
                json_object_put(root_obj);
                return -1;
        }