Fixed ArrayIndexOutOfBoundsException in getOreName

Added sanity check to prevent ArrayIndexOutOfBoundsException in getOreName for negative ids.
This commit is contained in:
Zarathul committed 2014-06-16 23:00:40 +02:00
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";
}
/**