mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fixed ArrayIndexOutOfBoundsException in getOreName
Added sanity check to prevent ArrayIndexOutOfBoundsException in getOreName for negative ids.
This commit is contained in:
1 parent
bb15efd037
commit
e68cfa9f72
1 file changed
+1
-1
@@ -282,7 +282,7 @@ public class OreDictionary
|
||||
*/
|
||||
public static String getOreName(int id)
|
||||
{
|
||||
return id < idToName.size() ? idToName.get(id) : "Unknown";
|
||||
return (id >= 0 && id < idToName.size()) ? idToName.get(id) : "Unknown";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user