diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 793c605268..5c010b4cef 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -339,7 +339,11 @@ void cmGlobalVisualStudio10Generator::EnableLanguage( const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const { - return this->GetPlatformToolsetString().c_str(); + std::string const& toolset = this->GetPlatformToolsetString(); + if (toolset.empty()) { + return CM_NULLPTR; + } + return toolset.c_str(); } std::string const& cmGlobalVisualStudio10Generator::GetPlatformToolsetString()