X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=handler.h;h=e3e2af5e86899a5a8f9be95c7719f565e44e2c22;hp=baf9c3c6c86c3137e1e727234031d4bc02df41b0;hb=HEAD;hpb=4716798f0c6ecf7953edee5bcc6eb34dc76f27b4 diff --git a/handler.h b/handler.h index baf9c3c..e3e2af5 100644 --- a/handler.h +++ b/handler.h @@ -15,7 +15,7 @@ #define __NETIFD_HANDLER_H #include -#include +#include #include "config.h" typedef void (*script_dump_cb)(const char *script, const char *name, json_object *obj); @@ -35,7 +35,8 @@ json_check_type(json_object *obj, json_type type) static inline json_object * json_get_field(json_object *obj, const char *name, json_type type) { - return json_check_type(json_object_object_get(obj, name), type); + return json_object_object_get_ex(obj, name, &obj) ? + json_check_type(obj, type) : NULL; } int netifd_open_subdir(const char *name);