Skip to content

Commit dbd7414

Browse files
committed
Fix NPE on waiting for a region-folder to appear too long
1 parent b086396 commit dbd7414

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/FileHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ public static boolean awaitExistence(Path path, long timeout, TimeUnit unit) thr
133133
while (!Files.exists(path)) {
134134
long now = System.currentTimeMillis();
135135
if (now >= endTime) return false;
136-
watchService.poll(endTime - now, TimeUnit.MILLISECONDS).reset();
136+
WatchKey key = watchService.poll(endTime - now, TimeUnit.MILLISECONDS);
137+
if (key != null) key.reset();
137138
}
138139
return true;
139140
}

0 commit comments

Comments
 (0)