Skip to content

Commit

Permalink
fix: Avoid null exception in removeSubquery
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Mar 1, 2024
1 parent 9aa42cd commit 55ce793
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ public static synchronized void setSubquery(long planId, ScalarSubquery subquery
}

public static synchronized void removeSubquery(long planId, ScalarSubquery subquery) {
subqueryMap.get(planId).remove(subquery.exprId().id());
if (subqueryMap.containsKey(planId)) {
subqueryMap.get(planId).remove(subquery.exprId().id());

if (subqueryMap.get(planId).isEmpty()) {
subqueryMap.remove(planId);
if (subqueryMap.get(planId).isEmpty()) {
subqueryMap.remove(planId);
}
}
}

Expand Down

0 comments on commit 55ce793

Please sign in to comment.