From 313dda0e4bc1e174a028fb227491d98e1cde1c71 Mon Sep 17 00:00:00 2001 From: Cian Ormond Date: Tue, 2 Apr 2024 20:24:22 -0700 Subject: [PATCH] Parse null if altitude isn't parse-able --- src/main/java/net/marvk/fs/vatsim/map/data/FlightPlan.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/marvk/fs/vatsim/map/data/FlightPlan.java b/src/main/java/net/marvk/fs/vatsim/map/data/FlightPlan.java index e1bfe6c9..33df448d 100644 --- a/src/main/java/net/marvk/fs/vatsim/map/data/FlightPlan.java +++ b/src/main/java/net/marvk/fs/vatsim/map/data/FlightPlan.java @@ -278,7 +278,11 @@ private static String parseAltitude(final String altitude) { final int multiplier = prefix == null ? 1 : 100; - return String.valueOf(Integer.parseInt(amount) * multiplier); + try { + return String.valueOf(Integer.parseInt(amount) * multiplier); + } catch (NumberFormatException e) { + return null; + } } return null; });