Fix server crash
This commit is contained in:
1 parent
969887e948
commit
6a538afd70
2 files changed
+6
-1
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user