diff options
-rw-r--r-- | src/main/java/com/gitblit/servlet/GitblitContext.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/com/gitblit/servlet/GitblitContext.java b/src/main/java/com/gitblit/servlet/GitblitContext.java index 750da796..cd8615a8 100644 --- a/src/main/java/com/gitblit/servlet/GitblitContext.java +++ b/src/main/java/com/gitblit/servlet/GitblitContext.java @@ -293,11 +293,13 @@ public class GitblitContext extends GuiceServletContextListener { logger.info("Gitblit context destroyed by servlet container."); IPluginManager pluginManager = getManager(IPluginManager.class); - for (LifeCycleListener listener : pluginManager.getExtensions(LifeCycleListener.class)) { - try { - listener.onShutdown(); - } catch (Throwable t) { - logger.error(null, t); + if (pluginManager != null) { + for (LifeCycleListener listener : pluginManager.getExtensions(LifeCycleListener.class)) { + try { + listener.onShutdown(); + } catch (Throwable t) { + logger.error(null, t); + } } } |