From e98f7b93a1ee43b86eb9380390885a577b153e37 Mon Sep 17 00:00:00 2001 From: Ludo Stellingwerff Date: Tue, 1 Dec 2015 10:01:38 +0100 Subject: [PATCH] Warn on incorrect input --- lib/DataSet.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/DataSet.js b/lib/DataSet.js index 25ede879..7ce19edb 100644 --- a/lib/DataSet.js +++ b/lib/DataSet.js @@ -259,7 +259,11 @@ DataSet.prototype.update = function (data, senderId) { if (Array.isArray(data)) { // Array for (var i = 0, len = data.length; i < len; i++) { - addOrUpdate(data[i]); + if (data[i] instanceof Object){ + addOrUpdate(data[i]); + } else { + console.warn("Ignoring input item, which is not an object at index"+i); + } } } else if (data instanceof Object) {