fix json_object_from_file return value handling
authorJohn Crispin <blogic@openwrt.org>
Sat, 23 Feb 2013 18:23:01 +0000 (19:23 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 23 Feb 2013 18:28:10 +0000 (19:28 +0100)
Signed-off-by: John Crispin <blogic@openwrt.org>
hotplug-rule.c

index b90ae52..cb31c3f 100644 (file)
@@ -467,7 +467,7 @@ rule_file_load(const char *filename)
                return NULL;
 
        obj = json_object_from_file((char *) filename);
-       if (!obj)
+       if (is_error(obj))
                return NULL;
 
        if (!json_object_is_type(obj, json_type_array)) {