diff --git a/src/app/features/templating/templateSrv.js b/src/app/features/templating/templateSrv.js index c44ff0a5669..8fc45097944 100644 --- a/src/app/features/templating/templateSrv.js +++ b/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; };