From d257ce50cf78cd29093d61bd8e2cbaa8cb886393 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 18 Jun 2024 11:56:19 -0400 Subject: [PATCH] Sanity check for null city. --- src/engine/db/handlers/dbWarehouseHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) 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;