소스 검색

fix: Web Workers have no window

Brian Zinn 5 년 전
부모
커밋
05b20885ff
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Offline/database.ts

+ 1 - 1
src/Offline/database.ts

@@ -92,7 +92,7 @@ export class Database implements IOfflineProvider {
     }
     }
 
 
     private static _ReturnFullUrlLocation = (url: string): string => {
     private static _ReturnFullUrlLocation = (url: string): string => {
-        if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1) {
+        if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1 && typeof window !== "undefined") {
             return (Database._ParseURL(window.location.href) + url);
             return (Database._ParseURL(window.location.href) + url);
         }
         }
         else {
         else {