From 3f4438e2ebc796fd5b2eab7018f270b6477f7d77 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 25 Sep 2018 08:47:20 +0300 Subject: [PATCH] Cppcheck: Replace assertion with a condition There are several editor types without path. Change-Id: Ieb7f3453ae83d6b64488a5f9381b5e7927ff1ece Reviewed-by: Nikolai Kosjar --- src/plugins/cppcheck/cppchecktrigger.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppcheck/cppchecktrigger.cpp b/src/plugins/cppcheck/cppchecktrigger.cpp index b9ce34448c8..af6423765c7 100644 --- a/src/plugins/cppcheck/cppchecktrigger.cpp +++ b/src/plugins/cppcheck/cppchecktrigger.cpp @@ -89,7 +89,8 @@ void CppcheckTrigger::checkEditors(const QList &editors) const auto document = editor->document(); QTC_ASSERT(document, continue); const auto &path = document->filePath(); - QTC_ASSERT(!path.isEmpty(), continue); + if (path.isEmpty()) + continue; if (m_checkedFiles.contains(path)) continue;