Continue with strict null fixes for Map.get possibly returning undefined

This commit is contained in:
Matt Bierner
2019-01-09 15:57:20 -08:00
parent c5d160afae
commit f89f4902ca
14 changed files with 44 additions and 33 deletions

View File

@@ -450,9 +450,9 @@ export class AsyncDataTree<TInput, T, TFilterData = void> implements IDisposable
// Implementation
private getDataNode(element: TInput | T): IAsyncDataTreeNode<TInput, T> {
const node: IAsyncDataTreeNode<TInput, T> = this.nodes.get((element === this.root.element ? null : element) as T);
const node: IAsyncDataTreeNode<TInput, T> | undefined = this.nodes.get((element === this.root.element ? null : element) as T);
if (typeof node === 'undefined') {
if (!node) {
throw new Error(`Data tree node not found: ${element}`);
}