File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -432,6 +432,9 @@ static std::vector<picojson::value> executeAddon(const AddonInfo &addonInfo,
432
432
const std::string &premiumArgs,
433
433
const CppCheck::ExecuteCmdFn &executeCommand)
434
434
{
435
+ if (!executeCommand)
436
+ throw InternalError (nullptr , " Failed to execute addon - no command callback provided" );
437
+
435
438
std::string pythonExe;
436
439
437
440
if (!addonInfo.executable .empty ())
@@ -686,6 +689,11 @@ unsigned int CppCheck::checkClang(const FileWithDetails &file, int fileIndex)
686
689
mErrorLogger .reportOut (exe + " " + args2, Color::Reset);
687
690
}
688
691
692
+ if (!mExecuteCommand ) {
693
+ std::cerr << " Failed to execute '" << exe << " " << args2 << " " << redirect2 << " ' - (no command callback provided)" << std::endl;
694
+ return 0 ; // TODO: report as failure?
695
+ }
696
+
689
697
std::string output2;
690
698
const int exitcode = mExecuteCommand (exe,split (args2),redirect2,output2);
691
699
if (mSettings .debugClangOutput ) {
@@ -1954,6 +1962,11 @@ void CppCheck::analyseClangTidy(const FileSettings &fileSettings)
1954
1962
}
1955
1963
#endif
1956
1964
1965
+ if (!mExecuteCommand ) {
1966
+ std::cerr << " Failed to execute '" << exe << " ' (no command callback provided)" << std::endl;
1967
+ return ;
1968
+ }
1969
+
1957
1970
// TODO: log this call
1958
1971
// TODO: get rid of hard-coded checks
1959
1972
const std::string args = " -quiet -checks=*,-clang-analyzer-*,-llvm* \" " + fileSettings.filename () + " \" -- " + allIncludes + allDefines;
You can’t perform that action at this time.
0 commit comments