Fix server crash

This commit is contained in:
dginovker
2019-10-11 14:09:45 -04:00
parent 969887e948
commit 6a538afd70
2 changed files with 6 additions and 1 deletions
@@ -227,7 +227,12 @@ public class ItemDefinitions {
* Returns the weight of an item.
*/
public static double getWeight(int id) {
return definitions[id].weight;
try {
return definitions[id].weight;
} catch (NullPointerException noId) {
System.out.println("WARNING: id " + id + " doesn't have a definition!");
return 0;
}
}
/**