mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-29 13:36:04 +01:00
Cleanup: Mark EconomyAPI as Nullable and fix potential NPE
This commit is contained in:
parent
d6673c8afd
commit
f547995164
@ -26,7 +26,7 @@ public class ReserveListener extends EconomyAdapter {
|
|||||||
|
|
||||||
private static @Nullable EconomyAPI economyAPI;
|
private static @Nullable EconomyAPI economyAPI;
|
||||||
|
|
||||||
public ReserveListener(EconomyAPI api) {
|
public ReserveListener(@Nullable EconomyAPI api) {
|
||||||
ReserveListener.economyAPI = api;
|
ReserveListener.economyAPI = api;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ public class ReserveListener extends EconomyAdapter {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onCurrencyHoldCheck(CurrencyHoldEvent event) {
|
public void onCurrencyHoldCheck(CurrencyHoldEvent event) {
|
||||||
if (event.getAccount() == null || event.wasHandled() || !transactionCanFail() || event.canHold()) {
|
if (!provided() || event.getAccount() == null || event.wasHandled() || !transactionCanFail() || event.canHold()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user