소스 검색

ENH: do not dereference empty stl vectors

Bill Hoffman 19 년 전
부모
커밋
f4e9a5e5ea
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      Source/cmExecuteProcessCommand.cxx

+ 2 - 2
Source/cmExecuteProcessCommand.cxx

@@ -295,11 +295,11 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args)
   cmExecuteProcessCommandFixText(tempError);
 
   // Store the output obtained.
-  if(!output_variable.empty())
+  if(!output_variable.empty() && tempOutput.size())
     {
     this->Makefile->AddDefinition(output_variable.c_str(), &*tempOutput.begin());
     }
-  if(!merge_output && !error_variable.empty())
+  if(!merge_output && !error_variable.empty() && tempError.size())
     {
     this->Makefile->AddDefinition(error_variable.c_str(), &*tempError.begin());
     }