From 39d0cf69cc8bb6cd99f95792148075a05ea9d395 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Mon, 13 Jan 2025 16:42:11 +0100 Subject: [PATCH] (#3054) Do not crash on invalid offset time We just carry on as if nothing happened --- .../web/datasets/SensorOffsets/TimeSeriesPlotData.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/WebApp/src/uk/ac/exeter/QuinCe/web/datasets/SensorOffsets/TimeSeriesPlotData.java b/WebApp/src/uk/ac/exeter/QuinCe/web/datasets/SensorOffsets/TimeSeriesPlotData.java index 8a57436a2..a7545ad3c 100644 --- a/WebApp/src/uk/ac/exeter/QuinCe/web/datasets/SensorOffsets/TimeSeriesPlotData.java +++ b/WebApp/src/uk/ac/exeter/QuinCe/web/datasets/SensorOffsets/TimeSeriesPlotData.java @@ -122,11 +122,13 @@ protected String getArray(SensorOffsets sensorOffsets, } protected Double getFirstSeriesValue(LocalDateTime time) { - return data.get(time).getFirst(); + Tuple tuple = data.get(time); + return null == tuple ? Double.NaN : tuple.getFirst(); } protected Double getSecondSeriesValue(LocalDateTime time) { - return data.get(time).getSecond(); + Tuple tuple = data.get(time); + return null == tuple ? Double.NaN : tuple.getSecond(); } /**