Adds a default value to the shell version cache response in case it returns undefined (#9250)
This commit is contained in:
parent
b4bfcd3ebc
commit
0dc2a6860e
1 changed files with 3 additions and 1 deletions
|
|
@ -159,7 +159,9 @@
|
|||
}
|
||||
|
||||
fetch('/async_info/shell_version').then(response => response.json()).then(json => {
|
||||
caches.match('/async_info/shell_version').then(cachedResponse => cachedResponse.json()).then(cacheJson => {
|
||||
caches.match('/async_info/shell_version')
|
||||
.then(cachedResponse => (cachedResponse === undefined) ? {} : cachedResponse.json())
|
||||
.then(cacheJson => {
|
||||
if (cacheJson['version'] != json['version']) {
|
||||
caches.open(staticCacheName)
|
||||
.then(cache => cache.addAll([
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue