From bb433f6f4ae8c0a59e135120a19f9bbb12788961 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 6 Nov 2023 09:44:53 -0500 Subject: [PATCH] Trap for parsing floats --- src/engine/db/handlers/dbBuildingHandler.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/db/handlers/dbBuildingHandler.java b/src/engine/db/handlers/dbBuildingHandler.java index 9360e380..3c9cc940 100644 --- a/src/engine/db/handlers/dbBuildingHandler.java +++ b/src/engine/db/handlers/dbBuildingHandler.java @@ -566,8 +566,12 @@ public class dbBuildingHandler extends dbHandlerBase { String[] vertStrings = rs.getString("vertices").split(";"); ArrayList vertArrayList = new ArrayList<>(); - for (int i = 0; i < vertStrings.length; i += 2) - vertArrayList.add(new Vector2f(Float.parseFloat(vertStrings[i]), Float.parseFloat(vertStrings[1 + 1]))); + try { + for (int i = 0; i < vertStrings.length; i += 2) + vertArrayList.add(new Vector2f(Float.parseFloat(vertStrings[i]), Float.parseFloat(vertStrings[1 + 1]))); + } catch (Exception e) { + Logger.error("propID: " + propID); + } ArrayList> meshList;