Skip to content

Commit

Permalink
Skip disabling if core failed to initialize
Browse files Browse the repository at this point in the history
Otherwise this will cause a NullPointerException.
  • Loading branch information
stephan-gh committed Apr 23, 2023
1 parent fc195b4 commit 75cf5cf
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public void onEnable() {

@Override
public void onDisable() {
if (core == null) return;
try {
core.stop();
} catch (ServerListPlusException ignored) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public void onEnable() {

@Override
public void onDisable() {
if (core == null) return;
try {
core.stop();
} catch (ServerListPlusException ignored) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public boolean enable() {

@Override
public void disable() {
if (core == null) return;
try {
core.stop();
} catch (ServerListPlusException ignored) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public void registerCommand(RegisterCommandEvent<Command.Raw> event) {

@Listener
public void stop(StoppedGameEvent event) {
if (core == null) return;
try {
core.stop();
} catch (ServerListPlusException ignored) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public void initialize(ProxyInitializeEvent event) {

@Subscribe
public void shutdown(ProxyShutdownEvent event) {
if (core == null) return;
try {
core.stop();
} catch (ServerListPlusException ignored) {}
Expand Down

0 comments on commit 75cf5cf

Please sign in to comment.