From 8f275232a700a84e7e923d5c82313ea8c57c873f Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Mon, 18 Dec 2023 10:39:33 +0100 Subject: [PATCH] Dev mode: add null checks to TimestampSet.isRestartNeeded() - we observed NPE in some edge cases during live reload (cherry picked from commit 3fb7924bbf12f6289a0160f807ed83ad80de3363) --- .../deployment/dev/RuntimeUpdatesProcessor.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java index 24a1c175a3059..0e44200ee8043 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java @@ -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, Boolean> e : watchedFilePredicates) { - if (e.getKey().test(changedFile)) { - ret = ret || e.getValue(); + ret = Boolean.FALSE; + if (watchedFilePredicates != null) { + for (Entry, Boolean> e : watchedFilePredicates) { + if (e.getKey().test(changedFile)) { + ret = ret || e.getValue(); + } } } }