Browse Source

Merge pull request #1504 from almende/fix_null_pointer

Warn on incorrect input
codeClimate
Jos de Jong 9 years ago
parent
commit
d9e3619998
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      lib/DataSet.js

+ 5
- 1
lib/DataSet.js View File

@ -261,7 +261,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) {

Loading…
Cancel
Save