bank: null check items
This commit is contained in:
@@ -51,7 +51,14 @@ class ContainerCalculation
|
|||||||
ContainerPrices calculate(Item[] items)
|
ContainerPrices calculate(Item[] items)
|
||||||
{
|
{
|
||||||
// Returns last calculation if inventory hasn't changed
|
// Returns last calculation if inventory hasn't changed
|
||||||
|
|
||||||
|
if (items == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
final int newHash = hashItems(items);
|
final int newHash = hashItems(items);
|
||||||
|
|
||||||
if (containerPrices != null && hash == newHash)
|
if (containerPrices != null && hash == newHash)
|
||||||
{
|
{
|
||||||
return containerPrices;
|
return containerPrices;
|
||||||
@@ -86,7 +93,7 @@ class ContainerCalculation
|
|||||||
final long storePrice = itemManager.getItemDefinition(id).getPrice();
|
final long storePrice = itemManager.getItemDefinition(id).getPrice();
|
||||||
final long alchPrice = (long) (storePrice * Constants.HIGH_ALCHEMY_MULTIPLIER);
|
final long alchPrice = (long) (storePrice * Constants.HIGH_ALCHEMY_MULTIPLIER);
|
||||||
alch += alchPrice * qty;
|
alch += alchPrice * qty;
|
||||||
ge += itemManager.getItemPrice(id) * qty;
|
ge += (long) itemManager.getItemPrice(id) * qty;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user