Skip to content

Commit

Permalink
Fix NPE (#2938)
Browse files Browse the repository at this point in the history
MultiMap.get() may return null.
  • Loading branch information
basilevs authored and laeubi committed Oct 22, 2023
1 parent 03a252b commit 8b64e14
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -199,7 +200,7 @@ public String getUrl(String contextName) {

public List<String> getAccessedUrls(String contextName) {
synchronized (contextName2accessedUrls) {
return List.copyOf(contextName2accessedUrls.get(contextName));
return List.copyOf(contextName2accessedUrls.getOrDefault(contextName, Collections.emptyList()));
}
}

Expand Down

0 comments on commit 8b64e14

Please sign in to comment.