Add null check

This commit is contained in:
Naoki Takezoe
2017-07-25 12:35:41 +09:00
parent 5b245978d4
commit 2a83c1b9ba

View File

@@ -134,6 +134,7 @@ class InitializeListener extends ServletContextListener with SystemSettingsServi
val cl = Thread.currentThread.getContextClassLoader val cl = Thread.currentThread.getContextClassLoader
try { try {
using(cl.getResourceAsStream("plugins/plugins.json")){ pluginsFile => using(cl.getResourceAsStream("plugins/plugins.json")){ pluginsFile =>
if(pluginsFile != null){
val pluginsJson = IOUtils.toString(pluginsFile, "UTF-8") val pluginsJson = IOUtils.toString(pluginsFile, "UTF-8")
FileUtils.forceMkdir(PluginRepository.LocalRepositoryDir) FileUtils.forceMkdir(PluginRepository.LocalRepositoryDir)
@@ -156,6 +157,7 @@ class InitializeListener extends ServletContextListener with SystemSettingsServi
} }
} }
} }
}
} catch { } catch {
case e: Exception => logger.error("Error in extracting bundled plugin", e) case e: Exception => logger.error("Error in extracting bundled plugin", e)
} }