diff --git a/src/engine/db/handlers/dbWarehouseHandler.java b/src/engine/db/handlers/dbWarehouseHandler.java index 9137f07c..27641a41 100644 --- a/src/engine/db/handlers/dbWarehouseHandler.java +++ b/src/engine/db/handlers/dbWarehouseHandler.java @@ -136,6 +136,12 @@ public class dbWarehouseHandler extends dbHandlerBase { int cityUID = rs.getInt("cityUUID"); JSONObject jsonObject = new JSONObject(rs.getString("warehouse")); City city = City.getCity(cityUID); + + if (city == null) { + Logger.error("No city " + cityUID + " for warehouse"); + continue; + } + city.warehouse = new Warehouse(jsonObject); city.warehouse.city = city;