Fix crash in GraphVizWriter when GRAPHVIZ_TARGET_IGNORE_REGEX is used

GraphVizWriter could crash if GRAPHVIZ_TARGET_IGNORE_REGEX was set.
Patch from Christian Ehrlicher.

Alex
This commit is contained in:
Alex Neundorf 2011-02-04 20:31:18 +01:00
parent aa78a60ca6
commit 00e7ea76e8
1 changed files with 6 additions and 0 deletions

View File

@ -272,6 +272,12 @@ void cmGraphVizWriter::WriteConnections(const char* targetName,
std::map<cmStdString, cmStdString>::const_iterator libNameIt =
this->TargetNamesNodes.find(libName);
// can happen e.g. if GRAPHVIZ_TARGET_IGNORE_REGEX is used
if(libNameIt == this->TargetNamesNodes.end())
{
continue;
}
std::string connectionName = myNodeName;
connectionName += "-";
connectionName += libNameIt->second;