Fixes NPE if Prism or CoreProtect are not installed (#87)

This commit is contained in:
Video 2024-03-02 14:38:49 -07:00 committed by GitHub
parent 532e82472b
commit 54015f668a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -94,7 +94,7 @@ public class BanCMD extends PlexCommand
if (rollBack)
{
if (plugin.getPrismHook().hasPrism())
if (plugin.getPrismHook() != null && plugin.getPrismHook().hasPrism())
{
PrismParameters parameters = plugin.getPrismHook().prismApi().createParameters();
parameters.addActionType("block-place");
@ -119,7 +119,7 @@ public class BanCMD extends PlexCommand
}
});
}
else if (plugin.getCoreProtectHook().hasCoreProtect())
else if (plugin.getCoreProtectHook() != null && plugin.getCoreProtectHook().hasCoreProtect())
{
PlexLog.debug("Testing coreprotect");
Bukkit.getGlobalRegionScheduler().run(plugin, scheduledTask ->

View File

@ -104,7 +104,7 @@ public class TempbanCMD extends PlexCommand
});
}
else */
if (plugin.getCoreProtectHook().hasCoreProtect())
if (plugin.getCoreProtectHook() != null && plugin.getCoreProtectHook().hasCoreProtect())
{
PlexLog.debug("Testing coreprotect");
Bukkit.getAsyncScheduler().runNow(plugin, scheduledTask ->