Browse Source

Check if the location object exists before using it

Ryan Tremblay 4 years ago
parent
commit
cefc67251e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Misc/fileTools.ts

+ 1 - 1
src/Misc/fileTools.ts

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