[Messaging] MessageStorage::removeConversations: check 'conversations' array for...
authorPiotr Dabrowski <p.dabrowski2@samsung.com>
Tue, 30 Dec 2014 10:45:22 +0000 (11:45 +0100)
committerPiotr Dabrowski <p.dabrowski2@samsung.com>
Tue, 30 Dec 2014 10:45:22 +0000 (11:45 +0100)
Change-Id: I0bfd0d1bcf93f35ac729bf76637b01f64a41b19e
Signed-off-by: Piotr Dabrowski <p.dabrowski2@samsung.com>
src/messaging/messaging_api.js

index 4442fd2..be56a96 100644 (file)
@@ -920,6 +920,12 @@ MessageStorage.prototype.removeConversations = function () {
         {name: 'errorCallback', type: types_.FUNCTION, optional: true, nullable: true}
     ]);
 
+    args.conversations.forEach(function (el) {
+        if (!el || el.constructor !== MessageConversation) {
+            throw new tizen.WebAPIException(tizen.WebAPIException.TYPE_MISMATCH_ERR);
+        }
+    });
+
     var self = this;
 
     bridge.async({