From a6e7761141ed379dc47f25f3fb8098f5b910a8b8 Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Tue, 31 Dec 2019 18:18:13 +0900 Subject: [PATCH] Fix NullPointerException --- src/main/java/JettyLauncher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/JettyLauncher.java b/src/main/java/JettyLauncher.java index 44c1acd91..630c04b42 100644 --- a/src/main/java/JettyLauncher.java +++ b/src/main/java/JettyLauncher.java @@ -97,7 +97,7 @@ public class JettyLauncher { WebAppContext context = new WebAppContext(); File tmpDir; - if(tmpDirPath.equals("")){ + if(tmpDirPath == null || tmpDirPath.equals("")){ tmpDir = new File(getGitBucketHome(), "tmp"); if(!tmpDir.exists()){ tmpDir.mkdirs(); @@ -120,7 +120,7 @@ public class JettyLauncher { ProtectionDomain domain = JettyLauncher.class.getProtectionDomain(); URL location = domain.getCodeSource().getLocation(); - context.setContextPath(contextPath); + context.setContextPath(contextPath == null ? "" : contextPath); context.setDescriptor(location.toExternalForm() + "/WEB-INF/web.xml"); context.setServer(server); context.setWar(location.toExternalForm());