From 0ed58987def05e0ed1015e6551402efd9ebf0889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20=C5=A0trobl?= Date: Thu, 14 Nov 2024 20:28:06 +0800 Subject: [PATCH] Fix #1139: NullPointerException when converting environment value (#152) --- .../enrollmentserver/impl/service/PushRegistrationService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/enrollment-server/src/main/java/com/wultra/app/enrollmentserver/impl/service/PushRegistrationService.java b/enrollment-server/src/main/java/com/wultra/app/enrollmentserver/impl/service/PushRegistrationService.java index 0c0129e6..8cf48aab 100644 --- a/enrollment-server/src/main/java/com/wultra/app/enrollmentserver/impl/service/PushRegistrationService.java +++ b/enrollment-server/src/main/java/com/wultra/app/enrollmentserver/impl/service/PushRegistrationService.java @@ -114,6 +114,9 @@ private static MobilePlatform convert(final PushRegisterRequest.Platform source) } private static ApnsEnvironment convert(final PushRegisterRequest.Environment source) { + if (source == null) { + return null; + } return switch (source) { case DEVELOPMENT -> ApnsEnvironment.DEVELOPMENT; case PRODUCTION -> ApnsEnvironment.PRODUCTION;