From ca8aa7485f0f43dd592edf415758c890a73bab38 Mon Sep 17 00:00:00 2001 From: cwisniew Date: Sat, 4 Nov 2023 01:05:13 +1030 Subject: [PATCH] check to make sure there is a filename before using it --- src/main/java/net/rptools/maptool/client/AppUtil.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/rptools/maptool/client/AppUtil.java b/src/main/java/net/rptools/maptool/client/AppUtil.java index e89e94caae..dc26950953 100644 --- a/src/main/java/net/rptools/maptool/client/AppUtil.java +++ b/src/main/java/net/rptools/maptool/client/AppUtil.java @@ -216,6 +216,11 @@ public static Path getInstallDirectory() { path = path.getParent().getParent().getParent(); } else { // First try to find MapTool* directory in path while (path != null) { + if (path.getFileName() == null) { + // We have gone too far! + path = null; + break; + } if (path.getFileName().toString().matches("(?i).*maptool.*")) { break; }