X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=handler.h;h=e96c05af13a3bbf9616d25b1c60a447b580d50e2;hp=ca74aa64526bb3ab3ab0c488f1fdf3421b265c7a;hb=e9d2014a478807c7fac0581bb4a145901a3f23b4;hpb=98ffa1331519ed3dd84bd351652ae0fde3df8c93;ds=sidebyside diff --git a/handler.h b/handler.h index ca74aa6..e96c05a 100644 --- a/handler.h +++ b/handler.h @@ -15,6 +15,7 @@ #define __NETIFD_HANDLER_H #include +#include #include "config.h" typedef void (*script_dump_cb)(const char *script, const char *name, json_object *obj); @@ -34,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);