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

(cherry picked from commit 3fb7924)
  • Loading branch information
mkouba authored and gsmet committed Dec 18, 2023
1 parent 9580343 commit 8f27523
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 8f27523

Please sign in to comment.