From 4fc87a52bec232e001e1ee21796acbaa21e95155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Erik=20St=C3=B8wer?= Date: Thu, 3 Aug 2023 21:56:47 +0200 Subject: [PATCH 1/2] Fix NPE in SystemMapper --- .../org/entur/lamassu/mapper/entitymapper/SystemMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/entur/lamassu/mapper/entitymapper/SystemMapper.java b/src/main/java/org/entur/lamassu/mapper/entitymapper/SystemMapper.java index 932fae0d..7777cbb8 100644 --- a/src/main/java/org/entur/lamassu/mapper/entitymapper/SystemMapper.java +++ b/src/main/java/org/entur/lamassu/mapper/entitymapper/SystemMapper.java @@ -87,7 +87,7 @@ public System mapSystem(GBFSData systemInformation, FeedProvider feedProvider) { system.setPhoneNumber(systemInformation.getPhoneNumber()); system.setEmail(systemInformation.getEmail()); system.setFeedContactEmail(system.getFeedContactEmail()); - system.setTimezone(systemInformation.getTimezone().value()); + system.setTimezone(systemInformation.getTimezone() != null ? systemInformation.getTimezone().value() : null); system.setLicenseUrl(systemInformation.getLicenseUrl()); system.setBrandAssets(mapBrandAssets(systemInformation.getBrandAssets())); system.setTermsUrl(systemInformation.getTermsUrl()); From ad216144890f2060cdebc3f22d60e5a51905cd49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Erik=20St=C3=B8wer?= Date: Thu, 3 Aug 2023 22:01:11 +0200 Subject: [PATCH 2/2] Formatting --- .../org/entur/lamassu/mapper/entitymapper/SystemMapper.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/entur/lamassu/mapper/entitymapper/SystemMapper.java b/src/main/java/org/entur/lamassu/mapper/entitymapper/SystemMapper.java index 7777cbb8..7c8651cd 100644 --- a/src/main/java/org/entur/lamassu/mapper/entitymapper/SystemMapper.java +++ b/src/main/java/org/entur/lamassu/mapper/entitymapper/SystemMapper.java @@ -87,7 +87,11 @@ public System mapSystem(GBFSData systemInformation, FeedProvider feedProvider) { system.setPhoneNumber(systemInformation.getPhoneNumber()); system.setEmail(systemInformation.getEmail()); system.setFeedContactEmail(system.getFeedContactEmail()); - system.setTimezone(systemInformation.getTimezone() != null ? systemInformation.getTimezone().value() : null); + system.setTimezone( + systemInformation.getTimezone() != null + ? systemInformation.getTimezone().value() + : null + ); system.setLicenseUrl(systemInformation.getLicenseUrl()); system.setBrandAssets(mapBrandAssets(systemInformation.getBrandAssets())); system.setTermsUrl(systemInformation.getTermsUrl());