瀏覽代碼

protection against null seg, listview

Adam Shaw 9 年之前
父節點
當前提交
614f3c3970
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/list/ListView.js

+ 4 - 1
src/list/ListView.js

@@ -98,7 +98,10 @@ var ListViewGrid = Grid.extend({
 
 			// detect when span won't go fully into the next day,
 			// and mutate the latest seg to the be the end.
-			if (span.end.hasTime() && span.end < dayStart.clone().add(this.view.nextDayThreshold)) {
+			if (
+				seg && !seg.isEnd && span.end.hasTime() &&
+				span.end < dayStart.clone().add(this.view.nextDayThreshold)
+			) {
 				seg.end = span.end.clone();
 				seg.isEnd = true;
 				break;