Browse Source

Fixed #1487: DataSet cannot remove an item with id `0` correctly

codeClimate
jos 8 years ago
parent
commit
c4636affc8
2 changed files with 4 additions and 1 deletions
  1. +3
    -0
      HISTORY.md
  2. +1
    -1
      lib/DataSet.js

+ 3
- 0
HISTORY.md View File

@ -21,6 +21,9 @@ http://visjs.org
Thanks @ludost.
- Fixed support for using a `DataView` in Graph2d. Thanks @ludost.
### DataSet
- Fixed #1487: DataSet cannot remove an item with id `0` correctly.
## 2015-11-27, version 4.10.0

+ 1
- 1
lib/DataSet.js View File

@ -704,7 +704,7 @@ DataSet.prototype._remove = function (id) {
}
else if (id instanceof Object) {
var itemId = id[this._fieldId];
if (itemId && this._data[itemId]) {
if (itemId !== undefined && this._data[itemId]) {
delete this._data[itemId];
this.length--;
return itemId;

Loading…
Cancel
Save