fixed more null references (#4841)

This commit is contained in:
Anthony Dresser
2019-04-03 16:30:58 -07:00
committed by GitHub
parent cef5bbb2be
commit e31de8b137

View File

@@ -37,7 +37,7 @@ export class HeightMap {
let totalSize: number; let totalSize: number;
let sizeDiff = 0; let sizeDiff = 0;
if (afterItemId === null) { if (afterItemId === undefined) {
i = 0; i = 0;
totalSize = 0; totalSize = 0;
} else { } else {
@@ -201,12 +201,12 @@ export class HeightMap {
return this.heightMap[index]; return this.heightMap[index];
} }
public itemAfter(item: IViewItem): IViewItem { public itemAfter(item: IViewItem): IViewItem | undefined {
return this.heightMap[this.indexes[item.view.id] + 1] || null; return this.heightMap[this.indexes[item.view.id] + 1] || undefined;
} }
public dispose(): void { public dispose(): void {
this.heightMap = null; this.heightMap = undefined;
this.indexes = null; this.indexes = undefined;
} }
} }