diff --git a/lib/executionpath.cpp b/lib/executionpath.cpp index 2bd6fcae5..d8a4300e1 100644 --- a/lib/executionpath.cpp +++ b/lib/executionpath.cpp @@ -402,6 +402,11 @@ void ExecutionPath::checkScope(const Token *tok, std::list &che if (tok && tok->str() == "if") continue; + if (!tok) { + ExecutionPath::bailOut(newchecks); + return; + } + // there is no "if".. ExecutionPath::checkScope(tok->next(), checks); tok = tok->link();