David Catuhe %!s(int64=5) %!d(string=hai) anos
pai
achega
6b9f08b6d6
Modificáronse 1 ficheiros con 3 adicións e 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;
     }