[njs] Improved njs_vm_value() in case of a value is not found.

Dmitry Volyntsev xeioex at nginx.com
Tue Apr 21 12:37:26 UTC 2020


details:   https://hg.nginx.org/njs/rev/ca4ab0a7ec76
branches:  
changeset: 1376:ca4ab0a7ec76
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Apr 21 11:56:37 2020 +0000
description:
Improved njs_vm_value() in case of a value is not found.

diffstat:

 src/njs_vm.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (14 lines):

diff -r f68270171435 -r ca4ab0a7ec76 src/njs_vm.c
--- a/src/njs_vm.c	Fri Apr 17 17:04:18 2020 +0000
+++ b/src/njs_vm.c	Tue Apr 21 11:56:37 2020 +0000
@@ -614,8 +614,8 @@ njs_vm_value(njs_vm_t *vm, const njs_str
         }
 
         ret = njs_value_property(vm, &value, &key, njs_value_arg(retval));
-        if (njs_slow_path(ret == NJS_ERROR)) {
-            return NJS_ERROR;
+        if (njs_slow_path(ret != NJS_OK)) {
+            return ret;
         }
 
         if (p == NULL) {


More information about the nginx-devel mailing list