Skip to content

Commit 9b49869

Browse files
committed
strengthen shutdown
1 parent 979bf72 commit 9b49869

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

hivemq-edge/src/main/java/com/hivemq/HiveMQEdgeMain.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,12 @@ public void start(final @Nullable EmbeddedExtension embeddedExtension)
174174

175175
public void stop() {
176176
stopGateway();
177-
try {
178-
Runtime.getRuntime().removeShutdownHook(shutdownThread);
179-
} catch (final IllegalStateException ignored) {
180-
//ignore
177+
if (shutdownThread != null) {
178+
try {
179+
Runtime.getRuntime().removeShutdownHook(shutdownThread);
180+
} catch (final IllegalStateException ignored) {
181+
//ignore
182+
}
181183
}
182184
}
183185

0 commit comments

Comments
 (0)