mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
Bug fix
This commit is contained in:
@@ -68,7 +68,7 @@ public class SendServlet extends HttpServlet {
|
|||||||
|
|
||||||
String deviceName = req.getParameter("deviceName");
|
String deviceName = req.getParameter("deviceName");
|
||||||
String deviceType = req.getParameter("deviceType");
|
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);
|
User user = RegisterServlet.checkUser(req, resp, false);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
@@ -108,16 +108,18 @@ public class SendServlet extends HttpServlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (DeviceInfo deviceInfo : registrations) {
|
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
|
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
|
continue; // user-specified device type
|
||||||
}
|
}
|
||||||
|
|
||||||
// if name or value are null - they'll be skipped
|
// if name or value are null - they'll be skipped
|
||||||
try {
|
try {
|
||||||
if (deviceInfo.getType().equals(DeviceInfo.TYPE_CHROME)) {
|
if (deviceInfo.getType() != null && deviceInfo.getType().equals(DeviceInfo.TYPE_CHROME)) {
|
||||||
res = doSendViaBrowserChannel(url, deviceInfo);
|
res = doSendViaBrowserChannel(url, deviceInfo);
|
||||||
} else {
|
} else {
|
||||||
res = doSendViaC2dm(url, title, sel, push, collapseKey, deviceInfo);
|
res = doSendViaC2dm(url, title, sel, push, collapseKey, deviceInfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user