mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-02-06 15:41:29 +01:00
Fix NPE on waiting for a region-folder to appear too long
This commit is contained in:
parent
b086396cd6
commit
dbd7414542
@ -133,7 +133,8 @@ public static boolean awaitExistence(Path path, long timeout, TimeUnit unit) thr
|
||||
while (!Files.exists(path)) {
|
||||
long now = System.currentTimeMillis();
|
||||
if (now >= endTime) return false;
|
||||
watchService.poll(endTime - now, TimeUnit.MILLISECONDS).reset();
|
||||
WatchKey key = watchService.poll(endTime - now, TimeUnit.MILLISECONDS);
|
||||
if (key != null) key.reset();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user