Forráskód Böngészése

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

Torkel Ödegaard 11 éve
szülő
commit
596dfc304d
1 módosított fájl, 3 hozzáadás és 0 törlés
  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;
     };