diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java index c3530b3b7f..9c44a4e0d3 100644 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java @@ -194,7 +194,7 @@ public class FileSystemWatcher { } this.watchThread = null; } - if (Thread.currentThread() != thread) { + if (thread != null && Thread.currentThread() != thread) { try { thread.join(); }