Skip to content

Commit

Permalink
🐛 Fix NPE on Optional Stages when ?avar qparam is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ujibang committed Jan 29, 2024
1 parent 9cb67a7 commit 5c5f950
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -138,6 +138,12 @@ private static void checkIfVar(STAGE_OPERATOR stageOperator, BsonDocument stage)
}

private static boolean stageApplies(STAGE_OPERATOR stageOperator, BsonDocument stage, BsonDocument avars) {
// false if request does not include the ?avars qparam
// see issue https://github.com/SoftInstigate/restheart/issues/500
if (avars == null) {
return false;
}

var vars = stage.get(stageOperator.name()).asArray().get(0);

if (vars.isString()) {
Expand Down

0 comments on commit 5c5f950

Please sign in to comment.