Fixing some strict null errors in mainThread

This commit is contained in:
Matt Bierner
2019-02-05 15:58:47 -08:00
parent ffe09d3642
commit 197a916fcb
4 changed files with 11 additions and 6 deletions

View File

@@ -64,13 +64,14 @@ export class MainThreadCommands implements MainThreadCommandsShape {
}
$unregisterCommand(id: string): void {
if (this._disposables.has(id)) {
this._disposables.get(id).dispose();
const command = this._disposables.get(id);
if (command) {
command.dispose();
this._disposables.delete(id);
}
}
$executeCommand<T>(id: string, args: any[]): Promise<T> {
$executeCommand<T>(id: string, args: any[]): Promise<T | undefined> {
for (let i = 0; i < args.length; i++) {
args[i] = revive(args[i], 0);
}