From 2ff7f10e88c8396e327a3ac854998c544abd2f5d Mon Sep 17 00:00:00 2001 From: Sukhpreet Singh Anand Date: Sat, 28 Jul 2018 03:52:57 +0530 Subject: [PATCH] Kept a check for preventing TypeError due to url variable being undefined. Provided fix for issue : https://github.com/angular/angular/issues/25154 --- ngsw-worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ngsw-worker.js b/ngsw-worker.js index c51de922da..8d42ded554 100755 --- a/ngsw-worker.js +++ b/ngsw-worker.js @@ -383,7 +383,7 @@ // Either the request matches one of the known resource URLs, one of the patterns for // dynamically matched URLs, or neither. Determine which is the case for this request in // order to decide how to handle it. - if (this.config.urls.indexOf(url) !== -1 || this.patterns.some(pattern => pattern.test(url))) { + if ((url !== undefined && this.config.urls.indexOf(url) !== -1) || this.patterns.some(pattern => pattern.test(url))) { // This URL matches a known resource. Either it's been cached already or it's missing, in // which case it needs to be loaded from the network. // Open the cache to check whether this resource is present.