Skip to content

Commit 440376a

Browse files
committed
Add guards for when settings have not yet resolved
1 parent e4fff91 commit 440376a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/model.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ export class GitExtension implements IGitExtension, IDisposable {
169169
return;
170170
}
171171
this._isDisposed = true;
172-
this._poll.dispose();
172+
if (this._poll) {
173+
this._poll.dispose();
174+
}
173175
Signal.clearData(this);
174176
}
175177

@@ -347,8 +349,12 @@ export class GitExtension implements IGitExtension, IDisposable {
347349
}
348350

349351
async refreshStatus(): Promise<void> {
350-
await this._poll.refresh();
351-
await this._poll.tick;
352+
if (this._poll) {
353+
await this._poll.refresh();
354+
await this._poll.tick;
355+
} else {
356+
await Promise.resolve();
357+
}
352358
}
353359

354360
/** Refresh the git repository status */

0 commit comments

Comments
 (0)