Xcode: Fix crash: avoid strlen call on NULL char *

Thanks to Johan Björk for the report on the CMake mailing list.
This commit is contained in:
David Cole 2011-01-27 06:57:12 -05:00
parent 451c5f61c2
commit b08657cf0f
1 changed files with 1 additions and 1 deletions

View File

@ -2693,7 +2693,7 @@ void cmGlobalXCodeGenerator
this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
const char* osxArch =
this->CurrentMakefile->GetDefinition("CMAKE_OSX_ARCHITECTURES");
if(strlen(osxArch) == 0)
if(!osxArch || strlen(osxArch) == 0)
{
if(this->XcodeVersion >= 32)
{