mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-02 16:49:03 +00:00
Fix server crash
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user