From 0cde7bf17c6f1532db86ac7a7f1a60dc786293a3 Mon Sep 17 00:00:00 2001 From: "burke.davey" Date: Mon, 13 Sep 2010 14:07:20 +0000 Subject: [PATCH] Bug fix --- .../android/chrometophone/server/SendServlet.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/appengine/src/com/google/android/chrometophone/server/SendServlet.java b/appengine/src/com/google/android/chrometophone/server/SendServlet.java index 91ed1ac..4bc88b8 100644 --- a/appengine/src/com/google/android/chrometophone/server/SendServlet.java +++ b/appengine/src/com/google/android/chrometophone/server/SendServlet.java @@ -68,7 +68,7 @@ public class SendServlet extends HttpServlet { String deviceName = req.getParameter("deviceName"); String deviceType = req.getParameter("deviceType"); - if (deviceType == null) deviceType = DeviceInfo.TYPE_AC2DM; + if (deviceType == null) deviceType = DeviceInfo.TYPE_AC2DM; // default User user = RegisterServlet.checkUser(req, resp, false); if (user != null) { @@ -108,16 +108,18 @@ public class SendServlet extends HttpServlet { } for (DeviceInfo deviceInfo : registrations) { - if (deviceName != null && !deviceName.equals(deviceInfo.getName())) { + if (deviceName != null && deviceInfo.getName() != null && + !deviceName.equals(deviceInfo.getName())) { continue; // user-specified device name } - if (deviceType != null && !deviceType.equals(deviceInfo.getType())) { + if (deviceType != null && deviceInfo.getType() != null && + !deviceType.equals(deviceInfo.getType())) { continue; // user-specified device type } // if name or value are null - they'll be skipped try { - if (deviceInfo.getType().equals(DeviceInfo.TYPE_CHROME)) { + if (deviceInfo.getType() != null && deviceInfo.getType().equals(DeviceInfo.TYPE_CHROME)) { res = doSendViaBrowserChannel(url, deviceInfo); } else { res = doSendViaC2dm(url, title, sel, push, collapseKey, deviceInfo);