Skip to content

Commit 68a686c

Browse files
committed
Fix: Prevent NullPointerException in getActiveEnvs by checking containsKey
1 parent 2139d2a commit 68a686c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/PortalSettings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public List<Env> getActiveEnvs() {
9999

100100
public boolean isEnvActive(Env env) {
101101
Boolean mark = envStatusMark.get(env);
102-
return mark != null && mark;
102+
return Boolean.TRUE.equals(mark);
103103
}
104104

105105
private class HealthCheckTask implements Runnable {
@@ -173,4 +173,4 @@ private void handleEnvDown(Env env) {
173173
}
174174

175175
}
176-
}
176+
}

0 commit comments

Comments
 (0)