mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
Fix possible NPEs in GameData
This commit is contained in:
1 parent
dcf069ca52
commit
58ba24add2
1 file changed
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user