summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/check-for-update.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/app/common/scripts/check-for-update.ts')
-rw-r--r--src/web/app/common/scripts/check-for-update.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/web/app/common/scripts/check-for-update.ts b/src/web/app/common/scripts/check-for-update.ts
index 0855676a42..fe539407da 100644
--- a/src/web/app/common/scripts/check-for-update.ts
+++ b/src/web/app/common/scripts/check-for-update.ts
@@ -9,7 +9,9 @@ export default async function(mios: MiOS) {
// Clear cache (serive worker)
try {
- navigator.serviceWorker.controller.postMessage('clear');
+ if (navigator.serviceWorker.controller) {
+ navigator.serviceWorker.controller.postMessage('clear');
+ }
navigator.serviceWorker.getRegistrations().then(registrations => {
registrations.forEach(registration => registration.unregister());