Null check the Item in the supplied stack as well as the stack itself.
This commit is contained in:
parent
4778c33902
commit
1275aa732e
|
@ -295,7 +295,7 @@ public class OreDictionary
|
|||
@Deprecated // Use getOreIds below for more accuracy
|
||||
public static int getOreID(ItemStack stack)
|
||||
{
|
||||
if (stack == null) return -1;
|
||||
if (stack == null || stack.getItem() == null) return -1;
|
||||
|
||||
int id = Item.getIdFromItem(stack.getItem());
|
||||
List<Integer> ids = stackToId.get(id); //Try the wildcard first
|
||||
|
@ -315,7 +315,7 @@ public class OreDictionary
|
|||
*/
|
||||
public static int[] getOreIDs(ItemStack stack)
|
||||
{
|
||||
if (stack == null) return new int[0];
|
||||
if (stack == null || stack.getItem() == null) return new int[0];
|
||||
|
||||
Set<Integer> set = new HashSet<Integer>();
|
||||
|
||||
|
|
Loading…
Reference in New Issue