Skip to content

Commit

Permalink
Dev mode: add null checks to TimestampSet.isRestartNeeded()
Browse files Browse the repository at this point in the history
- we observed NPE in some edge cases during live reload
  • Loading branch information
mkouba committed Dec 18, 2023
1 parent 731113d commit 3fb7924
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1309,12 +1309,14 @@ boolean isRestartNeeded(String changedFile) {
}
}
// Then try to match a new file that was added to a resource root
Boolean ret = watchedFilePaths.get(changedFile);
Boolean ret = watchedFilePaths != null ? watchedFilePaths.get(changedFile) : null;
if (ret == null) {
ret = false;
for (Entry<Predicate<String>, Boolean> e : watchedFilePredicates) {
if (e.getKey().test(changedFile)) {
ret = ret || e.getValue();
ret = Boolean.FALSE;
if (watchedFilePredicates != null) {
for (Entry<Predicate<String>, Boolean> e : watchedFilePredicates) {
if (e.getKey().test(changedFile)) {
ret = ret || e.getValue();
}
}
}
}
Expand Down

0 comments on commit 3fb7924

Please sign in to comment.