From 60a6e0282e8e013acb56821f30573c65f1a6c36d Mon Sep 17 00:00:00 2001 From: Knoobie Date: Thu, 13 Apr 2017 09:22:07 +0200 Subject: Check for NullPointer to remove exception spam --- .../java/com/vaadin/server/communication/PushHandler.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'server/src/main/java/com/vaadin') diff --git a/server/src/main/java/com/vaadin/server/communication/PushHandler.java b/server/src/main/java/com/vaadin/server/communication/PushHandler.java index 07b606c6e9..e65945d15c 100644 --- a/server/src/main/java/com/vaadin/server/communication/PushHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PushHandler.java @@ -308,8 +308,20 @@ public class PushHandler { // We don't want to use callWithUi here, as it assumes there's a client // request active and does requestStart and requestEnd among other // things. + if(event == null){ + getLogger().log(Level.SEVERE, + "Could not get event. This should never happen."); + return; + } AtmosphereResource resource = event.getResource(); + + if(resource == null){ + getLogger().log(Level.SEVERE, + "Could not get resource. This should never happen."); + return; + } + VaadinServletRequest vaadinRequest = new VaadinServletRequest( resource.getRequest(), service); VaadinSession session = null; -- cgit v1.2.3