From 4471e7ff81a1baedfcbf54bd493908c3463eb815 Mon Sep 17 00:00:00 2001 From: Tomasz Marciniak Date: Mon, 16 May 2016 14:20:59 +0200 Subject: [PATCH] [Push] Return null in case there is no data received. [Feature] If native api return PUSH_SERVICE_ERROR_NO_DATA in JS layer null object should be returned. [Verification] Code compiles. Change-Id: Id34aaacf5494208ae022ef4403cdbf9dac212860 Signed-off-by: Tomasz Marciniak --- src/push/push_api.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/push/push_api.js b/src/push/push_api.js index 8b36f7ad..afa13787 100644 --- a/src/push/push_api.js +++ b/src/push/push_api.js @@ -168,7 +168,8 @@ PushManager.prototype.getPushMessage = function() { if (native.isFailure(ret)) { throw native.getErrorObject(ret); } else { - return new PushMessage(native.getResultObject(ret)); + var message = native.getResultObject(ret); + return message ? new PushMessage(message) : null; } }; -- 2.34.1