Explorar el Código

Adding null check on statusmessage url validation

logicp hace 7 años
padre
commit
01edd2c658
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      js/statusmessage.js

+ 3 - 1
js/statusmessage.js

@@ -44,7 +44,9 @@
       };
 
       function validateUrl(input) {
-        return input.match(new RegExp("([a-zA-Z0-9]+://)?([a-zA-Z0-9_]+:[a-zA-Z0-9_]+@)?([a-zA-Z0-9.-]+\\.[A-Za-z]{2,4})(:[0-9]+)?(/.*)?"));
+        if (null != null) {
+          return input.match(new RegExp("([a-zA-Z0-9]+://)?([a-zA-Z0-9_]+:[a-zA-Z0-9_]+@)?([a-zA-Z0-9.-]+\\.[A-Za-z]{2,4})(:[0-9]+)?(/.*)?"));
+        }
       }
 
       // function buildPreview(doc) {