We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c16053 commit 2aeacb9Copy full SHA for 2aeacb9
jsonb_vodka_ops.c
@@ -427,11 +427,18 @@ vodkaqueryjsonbextract(PG_FUNCTION_ARGS)
427
case JsQueryMatchStrategyNumber:
428
jq = PG_GETARG_JSQUERY(0);
429
root = extractJsQuery(jq, make_entry_handler, (Pointer)&e);
430
-
431
- *nentries = e.count;
432
- keys = e.entries;
433
- for (i = 0; i < e.count; i++)
434
- keys[i].extra = (Pointer)root;
+ if (root)
+ {
+ *nentries = e.count;
+ keys = e.entries;
+ for (i = 0; i < e.count; i++)
435
+ keys[i].extra = (Pointer)root;
436
+ }
437
+ else
438
439
+ *nentries = 0;
440
+ keys = NULL;
441
442
break;
443
444
default:
0 commit comments