Skip to content

Commit

Permalink
fix: composer crashed when delete the dialog (microsoft#2290)
Browse files Browse the repository at this point in the history
Co-authored-by: Dong Lei <[email protected]>
  • Loading branch information
lei9444 and boydc2014 authored Mar 17, 2020
1 parent 7e53610 commit 97b9698
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Composer/packages/client/src/utils/luFileStatusStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ class LuFileStatusStorage {
}

public removeFile(botName: string, fileId: string) {
delete this._all[botName][fileId];
this.storage.set(KEY, this._all);
if (typeof this._all[botName]?.[fileId] !== 'undefined') {
delete this._all[botName][fileId];
this.storage.set(KEY, this._all);
}
}

public createFile(botName: string, fileId: string) {
Expand Down

0 comments on commit 97b9698

Please sign in to comment.