don't fail when insert first or appending a tile

This commit is contained in:
Bruno Windels 2019-06-02 15:15:14 +02:00
parent 1ed3babfec
commit 674007d892

View file

@ -88,8 +88,8 @@ export default class TilesCollection extends BaseObservableList {
const newTile = this._tileCreator(entry);
if (newTile) {
prevTile.updateNextSibling(newTile);
nextTile.updatePreviousSibling(newTile);
prevTile && prevTile.updateNextSibling(newTile);
nextTile && nextTile.updatePreviousSibling(newTile);
this._tiles.splice(tileIdx, 0, newTile);
this.emitAdd(tileIdx, newTile);
}