From 428f7b93ee7c26df50bb1dbb7e37967adc8bf523 Mon Sep 17 00:00:00 2001 From: zengkid Date: Fri, 14 Aug 2020 20:02:46 +0800 Subject: [PATCH] fixed not null --- .../runner/TomcatRunConfigurationProducer.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/poratu/idea/plugins/tomcat/runner/TomcatRunConfigurationProducer.java b/src/main/java/com/poratu/idea/plugins/tomcat/runner/TomcatRunConfigurationProducer.java index a83ca8e..e930d98 100644 --- a/src/main/java/com/poratu/idea/plugins/tomcat/runner/TomcatRunConfigurationProducer.java +++ b/src/main/java/com/poratu/idea/plugins/tomcat/runner/TomcatRunConfigurationProducer.java @@ -62,12 +62,14 @@ public boolean isConfigurationFromContext(@NotNull TomcatRunConfiguration config VirtualFile vf = context.getLocation().getVirtualFile(); if (vf != null && vf.isDirectory()) { Module module = context.getModule(); - Optional webModule = getWebModule(module); - boolean isWebModule = webModule.isPresent(); - if (isWebModule) { - VirtualFile virtualFile = webModule.get(); - if (vf.getCanonicalPath().equals(virtualFile.getCanonicalPath())) { - result = true; + if (module != null) { + Optional webModule = getWebModule(module); + boolean isWebModule = webModule.isPresent(); + if (isWebModule) { + VirtualFile virtualFile = webModule.get(); + if (vf.getCanonicalPath().equals(virtualFile.getCanonicalPath())) { + result = true; + } } } }