diff --git a/HISTORY.md b/HISTORY.md index 0e551cd3..6ef7d9c2 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -4,8 +4,9 @@ http://visjs.org ## not yet released, version 4.11.1-SNAPSHOT +### Timeline - +- Fixed #1527: error when creating/updating a Timeline without data. ## 2015-12-18, version 4.11.0 diff --git a/lib/timeline/Timeline.js b/lib/timeline/Timeline.js index 50de9f48..dd71796d 100644 --- a/lib/timeline/Timeline.js +++ b/lib/timeline/Timeline.js @@ -379,8 +379,8 @@ Timeline.prototype.fit = function (options) { Timeline.prototype.getItemRange = function () { // get a rough approximation for the range based on the items start and end dates var range = this.getDataRange(); - var min = range.min.valueOf(); - var max = range.max.valueOf(); + var min = range.min !== null ? range.min.valueOf() : null; + var max = range.max !== null ? range.max.valueOf() : null; var minItem = null; var maxItem = null;