GUACAMOLE-2181: Avoid NPE if servlet container is shut down before extensions are loaded.

This commit is contained in:
Michael Jumper committed 2025-12-12 10:42:28 -08:00
1 parent 751ca979ce
commit 10558b2682
1 file changed
+9 -7
@@ -297,13 +297,15 @@ public class GuacamoleServletContextListener extends GuiceServletContextListener
}
// Inform any listeners that application shutdown has completed
try {
listenerService.handleEvent(new ApplicationShutdownEvent() {
// The application shutdown event currently has no content
});
}
catch (GuacamoleException e) {
logger.error("An extension listening for application shutdown failed: {}", e.getMessage(), e);
if (listenerService != null) {
try {
listenerService.handleEvent(new ApplicationShutdownEvent() {
// The application shutdown event currently has no content
});
}
catch (GuacamoleException e) {
logger.error("An extension listening for application shutdown failed: {}", e.getMessage(), e);
}
}
}