summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/nxt_http_js.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nxt_http_js.c b/src/nxt_http_js.c
index e3beb8b4..3dbf7970 100644
--- a/src/nxt_http_js.c
+++ b/src/nxt_http_js.c
@@ -162,6 +162,7 @@ static njs_int_t
nxt_http_js_ext_get_args(njs_vm_t *vm, njs_object_prop_t *prop,
njs_value_t *value, njs_value_t *setval, njs_value_t *retval)
{
+ u_char *start;
njs_int_t ret;
njs_value_t *args;
njs_opaque_value_t val;
@@ -175,8 +176,8 @@ nxt_http_js_ext_get_args(njs_vm_t *vm, njs_object_prop_t *prop,
args = njs_value_arg(&val);
- ret = njs_vm_query_string_parse(vm, r->args->start,
- r->args->start + r->args->length, args);
+ start = (r->args->start != NULL) ? r->args->start : (u_char *) "";
+ ret = njs_vm_query_string_parse(vm, start, start + r->args->length, args);
if (ret == NJS_ERROR) {
return NJS_ERROR;