Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

PushNotificationHandler.java NPE bug fix

Rich Turner8501852dadda
diff --git a/manager/src/main/java/org/openremote/manager/notification/PushNotificationHandler.java b/manager/src/main/java/org/openremote/manager/notification/PushNotificationHandler.java
index 9c00c2384..a4d82bb20 100644
--- a/manager/src/main/java/org/openremote/manager/notification/PushNotificationHandler.java
+++ b/manager/src/main/java/org/openremote/manager/notification/PushNotificationHandler.java
@@ -509,7 +509,7 @@ public class PushNotificationHandler extends RouteBuilder implements Notificatio
return asset.getConsoleProviders().flatMap(consoleProviders ->
Optional.ofNullable(consoleProviders.get(PushNotificationMessage.TYPE))
.map(ConsoleProvider::getData)
- .map(data -> data.get("token").asText()));
+ .map(data -> data.get("token") != null ? data.get("token").asText() : null));
}
protected void processConsoleAssetChange(ConsoleAsset asset, PersistenceEvent<ConsoleAsset> persistenceEvent) {