When GitBlit server did not start properly, is running but couldn't
start the `PluginManager`, then stopping the server via the `--stop`
argument on the command line resulted in a NullpointerException.
Which left the server running. Now this is prevented and the server
will actually shut down.
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);
+ }
}
}