David Catuhe hace 5 años
padre
commit
6b9f08b6d6
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/Misc/stringTools.ts

+ 3 - 0
src/Misc/stringTools.ts

@@ -19,6 +19,9 @@ export class StringTools {
      * @returns Boolean indicating whether the suffix was found (true) or not (false)
      */
     public static StartsWith(str: string, suffix: string): boolean {
+        if (!str) {
+            return false;
+        }
         return str.indexOf(suffix) === 0;
     }