From: Igor Sysoev Date: Thu, 21 Jul 2016 17:51:22 +0000 (+0300) Subject: njs_vm_function() must return only function. X-Git-Tag: 0.1.0~4 X-Git-Url: http://git.kaiwu.me/sitemap.xml?a=commitdiff_plain;h=4f9bebdc45d371a0e98210dcfd4e6a94dc6b4724;p=njs.git njs_vm_function() must return only function. --- diff --git a/njs/njs_variable.c b/njs/njs_variable.c index a102a309..7ad8c6b8 100644 --- a/njs/njs_variable.c +++ b/njs/njs_variable.c @@ -139,7 +139,11 @@ njs_vm_function(njs_vm_t *vm, nxt_str_t *name) value = (njs_value_t *) ((u_char *) vm->global_scope + njs_offset(var->index) - NJS_INDEX_GLOBAL_OFFSET); - return value->data.u.function; + if (njs_is_function(value)) { + return value->data.u.function; + } + + return NULL; }