Skip to content

Commit

Permalink
Added API null check to prevent plugin from loading when this happens (
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed May 20, 2022
1 parent 402f946 commit e383295
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -213,6 +213,13 @@ public void onLoad() {
@Override
public void onEnable() {
try {
if (SuperiorSkyblockAPI.getSuperiorSkyblock() == null) {
shouldEnable = false;
HandlerLoadException.handle(new HandlerLoadException("The API instance was not initialized properly. Contact Ome_R regarding this!",
HandlerLoadException.ErrorLevel.SERVER_SHUTDOWN));
return;
}

if (!shouldEnable) {
Bukkit.shutdown();
return;
Expand Down

0 comments on commit e383295

Please sign in to comment.