Skip to content

Commit 1b5b573

Browse files
committed
1 parent 223dac8 commit 1b5b573

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/serviceWorker.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function registerValidSW(swUrl, config) {
6969
window.location.reload();
7070

7171
// Execute callback
72-
if (config.onUpdate) {
72+
if (config && config.onUpdate) {
7373
config.onUpdate(registration);
7474
}
7575
} else {
@@ -79,7 +79,7 @@ function registerValidSW(swUrl, config) {
7979
console.log("Content is cached for offline use.");
8080

8181
// Execute callback
82-
if (config.onSuccess) {
82+
if (config && config.onSuccess) {
8383
config.onSuccess(registration);
8484
}
8585
}

0 commit comments

Comments
 (0)