From: Tomasz Marciniak Date: Mon, 16 May 2016 12:20:59 +0000 (+0200) Subject: [Push] Return null in case there is no data received. X-Git-Tag: submit/tizen/20160517.094633~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F52%2F69752%2F1;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [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 --- 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; } };