Changed how currency types is initialized to avoid possible NPE

This commit is contained in:
Jonathan Williams 2016-03-19 15:33:16 -05:00
parent 9b65926d42
commit 8427ead097

View File

@ -36,7 +36,7 @@ public abstract class ShopBase<PluginType extends MiniPlugin> implements Listene
private NautHashMap<String, Long> _errorThrottling; private NautHashMap<String, Long> _errorThrottling;
private NautHashMap<String, Long> _purchaseBlock; private NautHashMap<String, Long> _purchaseBlock;
private List<CurrencyType> _availableCurrencyTypes; private List<CurrencyType> _availableCurrencyTypes = new ArrayList<CurrencyType>();
private PluginType _plugin; private PluginType _plugin;
private CoreClientManager _clientManager; private CoreClientManager _clientManager;
@ -57,7 +57,7 @@ public abstract class ShopBase<PluginType extends MiniPlugin> implements Listene
_errorThrottling = new NautHashMap<String, Long>(); _errorThrottling = new NautHashMap<String, Long>();
_purchaseBlock = new NautHashMap<String, Long>(); _purchaseBlock = new NautHashMap<String, Long>();
_availableCurrencyTypes = new ArrayList<CurrencyType>(); if (currencyTypes != null && currencyTypes.length > 0)
_availableCurrencyTypes.addAll(Arrays.asList(currencyTypes)); _availableCurrencyTypes.addAll(Arrays.asList(currencyTypes));
_plugin.registerEvents(this); _plugin.registerEvents(this);