From 60e1654d96162621568d27c5d9cdd64e4b1701d5 Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Tue, 3 Sep 2024 13:12:00 +0200
Subject: [PATCH] Fix NullPointerException when running for a specific weather
 station

---
 .../scheduling/tasks/RunAllForecastConfigurationsTask.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/main/java/no/nibio/vips/logic/scheduling/tasks/RunAllForecastConfigurationsTask.java b/src/main/java/no/nibio/vips/logic/scheduling/tasks/RunAllForecastConfigurationsTask.java
index b0978823..7f08a039 100755
--- a/src/main/java/no/nibio/vips/logic/scheduling/tasks/RunAllForecastConfigurationsTask.java
+++ b/src/main/java/no/nibio/vips/logic/scheduling/tasks/RunAllForecastConfigurationsTask.java
@@ -111,7 +111,11 @@ public class RunAllForecastConfigurationsTask extends VipsLogicTask{
                     else if(
                         weatherStationPointOfInterestId == null
                         || weatherStationPointOfInterestId <= 0
-                        || (forecastConfiguration.getWeatherStationPointOfInterestId() != null && forecastConfiguration.getWeatherStationPointOfInterestId().getPointOfInterestId().equals(weatherStationPointOfInterestId))
+                        || (
+                            forecastConfiguration.getWeatherStationPointOfInterestId() != null 
+                            && forecastConfiguration.getWeatherStationPointOfInterestId().getPointOfInterestId() != null 
+                            && forecastConfiguration.getWeatherStationPointOfInterestId().getPointOfInterestId().equals(weatherStationPointOfInterestId)
+                           )
                     )
 
                     {
-- 
GitLab