Skip to content

Commit

Permalink
storage helper #9: fixed storageHelper may be undefined during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLeoni committed Sep 7, 2020
1 parent 49d2960 commit 85ec1c5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/extensions/botch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,12 @@ class Scratch3Botch {
* @since botch-0.3
*/
resetStorage (){
this.storageHelper.clear();
this.runtime.emit(Scratch3Botch.BOTCH_STORAGE_HELPER_UPDATE);
if (this.storageHelper){
this.storageHelper.clear();
this.runtime.emit(Scratch3Botch.BOTCH_STORAGE_HELPER_UPDATE);
} else {
log.log('this.storageHelper undefined, skipping resetStorage');
}
}

/**
Expand Down

0 comments on commit 85ec1c5

Please sign in to comment.