Fix NullPointerException

This commit is contained in:
Naoki Takezoe
2019-12-31 18:18:13 +09:00
parent eb053a66d7
commit a6e7761141

View File

@@ -97,7 +97,7 @@ public class JettyLauncher {
WebAppContext context = new WebAppContext(); WebAppContext context = new WebAppContext();
File tmpDir; File tmpDir;
if(tmpDirPath.equals("")){ if(tmpDirPath == null || tmpDirPath.equals("")){
tmpDir = new File(getGitBucketHome(), "tmp"); tmpDir = new File(getGitBucketHome(), "tmp");
if(!tmpDir.exists()){ if(!tmpDir.exists()){
tmpDir.mkdirs(); tmpDir.mkdirs();
@@ -120,7 +120,7 @@ public class JettyLauncher {
ProtectionDomain domain = JettyLauncher.class.getProtectionDomain(); ProtectionDomain domain = JettyLauncher.class.getProtectionDomain();
URL location = domain.getCodeSource().getLocation(); URL location = domain.getCodeSource().getLocation();
context.setContextPath(contextPath); context.setContextPath(contextPath == null ? "" : contextPath);
context.setDescriptor(location.toExternalForm() + "/WEB-INF/web.xml"); context.setDescriptor(location.toExternalForm() + "/WEB-INF/web.xml");
context.setServer(server); context.setServer(server);
context.setWar(location.toExternalForm()); context.setWar(location.toExternalForm());