diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index bdb33bcdf..de95aa593 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -272,6 +272,12 @@ void cmGraphVizWriter::WriteConnections(const char* targetName, std::map::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;