From 85ec1c520b545ea870a73327f11ae8352c827124 Mon Sep 17 00:00:00 2001 From: David Leoni Date: Mon, 7 Sep 2020 23:06:47 +0200 Subject: [PATCH] storage helper #9: fixed storageHelper may be undefined during tests --- src/extensions/botch/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/extensions/botch/index.js b/src/extensions/botch/index.js index 5c59eef950a..f52e2538027 100644 --- a/src/extensions/botch/index.js +++ b/src/extensions/botch/index.js @@ -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'); + } } /**