提交 49316a04 编写于 作者: M Matt Bierner

Avoid direct compare with null if we only care that some obj is returned

上级 25ed721e
...@@ -257,7 +257,7 @@ export abstract class CompositeRegistry<T extends Composite> extends Disposable ...@@ -257,7 +257,7 @@ export abstract class CompositeRegistry<T extends Composite> extends Disposable
protected deregisterComposite(id: string): void { protected deregisterComposite(id: string): void {
const descriptor = this.compositeById(id); const descriptor = this.compositeById(id);
if (descriptor === null) { if (!descriptor) {
return; return;
} }
......
...@@ -601,7 +601,7 @@ export class MarkerViewModel extends Disposable { ...@@ -601,7 +601,7 @@ export class MarkerViewModel extends Disposable {
return Promise.resolve(model); return Promise.resolve(model);
} }
if (waitForModel) { if (waitForModel) {
if (this.modelPromise === null) { if (!this.modelPromise) {
this.modelPromise = createCancelablePromise(cancellationToken => { this.modelPromise = createCancelablePromise(cancellationToken => {
return new Promise((c) => { return new Promise((c) => {
this._register(this.modelService.onModelAdded(model => { this._register(this.modelService.onModelAdded(model => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册