diff --git a/lib/importproject.cpp b/lib/importproject.cpp index 2c684ca33..08ec3c672 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -189,7 +189,7 @@ ImportProject::Type ImportProject::import(const std::string &filename, Settings } else if (endsWith(filename, ".bpr", 4)) { importBcb6Prj(filename); return ImportProject::Type::BORLAND; - } else if (endsWith(filename, ".cppcheck", 9)) { + } else if (settings && endsWith(filename, ".cppcheck", 9)) { return importCppcheckGuiProject(fin, settings) ? ImportProject::Type::CPPCHECK_GUI : ImportProject::Type::MISSING; } return ImportProject::Type::UNKNOWN; diff --git a/lib/importproject.h b/lib/importproject.h index de07b9102..90952f6ba 100644 --- a/lib/importproject.h +++ b/lib/importproject.h @@ -94,7 +94,7 @@ public: void ignoreOtherConfigs(const std::string &cfg); void ignoreOtherPlatforms(cppcheck::Platform::PlatformType platformType); - Type import(const std::string &filename, Settings *settings); + Type import(const std::string &filename, Settings *settings=nullptr); protected: void importCompileCommands(std::istream &istr); bool importCppcheckGuiProject(std::istream &istr, Settings *settings);