Explorar o código

Merge pull request #9335 from ryantrem/location-defined-check

Check if the location object exists before using it
David Catuhe %!s(int64=4) %!d(string=hai) anos
pai
achega
9f7668d6c7
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Misc/fileTools.ts

+ 1 - 1
src/Misc/fileTools.ts

@@ -469,7 +469,7 @@ export class FileTools {
      * @returns boolean
      */
     public static IsFileURL(): boolean {
-        return location.protocol === "file:";
+        return typeof location !== "undefined" && location.protocol === "file:";
     }
 }