From fae55d2eb22f3ba7ba943447f032acdf58475f3e Mon Sep 17 00:00:00 2001 From: John Gemignani Date: Wed, 29 Jun 2022 15:30:47 -0700 Subject: [PATCH] Fix VLE peek stack Fix the VLE peek_stack_head routine to return a NULL if the stack is NULL. --- src/backend/utils/adt/age_graphid_ds.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backend/utils/adt/age_graphid_ds.c b/src/backend/utils/adt/age_graphid_ds.c index dabf7f9b0..a0b50ab7d 100644 --- a/src/backend/utils/adt/age_graphid_ds.c +++ b/src/backend/utils/adt/age_graphid_ds.c @@ -63,9 +63,14 @@ int64 get_stack_size(ListGraphId *stack) return stack->size; } -/* return a reference to the head entry in the stack */ +/* return a reference to the head entry in the stack, or NULL if empty */ GraphIdNode *peek_stack_head(ListGraphId *stack) { + if (stack == NULL) + { + return NULL; + } + return stack->head; }