diff options
-rw-r--r-- | Source/cmVariableWatch.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx index d049cdd..8ad6fce 100644 --- a/Source/cmVariableWatch.cxx +++ b/Source/cmVariableWatch.cxx @@ -80,6 +80,10 @@ void cmVariableWatch::RemoveWatch(const std::string& variable, WatchMethod method, void* client_data /*=0*/) { + if ( !this->WatchMap.count(variable) ) + { + return; + } cmVariableWatch::VectorOfPairs* vp = &this->WatchMap[variable]; cmVariableWatch::VectorOfPairs::iterator it; for ( it = vp->begin(); it != vp->end(); ++it ) |