Fix possible NPEs in GameData
This commit is contained in:
parent
8974a78c0a
commit
4d442ac219
1 changed files with 2 additions and 2 deletions
|
@ -285,7 +285,7 @@ public class GameData {
|
|||
}
|
||||
static Item findItem(String modId, String name)
|
||||
{
|
||||
if (modObjectTable == null)
|
||||
if (modObjectTable == null || !modObjectTable.contains(modId, name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -301,7 +301,7 @@ public class GameData {
|
|||
}
|
||||
|
||||
Integer blockId = modObjectTable.get(modId, name);
|
||||
if (blockId >= Block.field_71973_m.length)
|
||||
if (blockId == null || blockId >= Block.field_71973_m.length)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue