Explorar el Código

Added guard for template variables missing query field, Fixes #1501

Torkel Ödegaard hace 11 años
padre
commit
596dfc304d
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/app/features/templating/templateSrv.js

+ 3 - 0
src/app/features/templating/templateSrv.js

@@ -45,6 +45,9 @@ function (angular, _) {
     };
 
     this.containsVariable = function(str, variableName) {
+      if (!str) {
+        return false;
+      }
       return str.indexOf('$' + variableName) !== -1 || str.indexOf('[[' + variableName + ']]') !== -1;
     };