diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2015-03-25 16:38:37 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2015-03-25 16:38:37 (GMT) |
commit | a4a1b729c63ec81037af06ac1009d12cc1dc3188 (patch) | |
tree | 3b96b876cb9d9ddc9d2fd3b0a8c339fa49cbc5a8 /Source/cmMakefile.cxx | |
parent | 51b4321e5fdf9f7cbc54881037a45a474883ef47 (diff) | |
download | CMake-a4a1b729c63ec81037af06ac1009d12cc1dc3188.zip CMake-a4a1b729c63ec81037af06ac1009d12cc1dc3188.tar.gz CMake-a4a1b729c63ec81037af06ac1009d12cc1dc3188.tar.bz2 |
Fix warnings from clang scanbuild.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index eeb9c72..7f355a6 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2208,7 +2208,7 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name, if(i==lastElement) { // group already exists, replace its regular expression - if ( regex ) + if ( regex && sg) { // We only want to set the regular expression. If there are already // source files in the group, we don't want to remove them. @@ -2224,7 +2224,11 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name, sg = this->GetSourceGroup(currentName); i = 0; // last component found } - + if(!sg) + { + cmSystemTools::Error("Could not create source group "); + return; + } // build the whole source group path const char* fullname = sg->GetFullName(); cmGlobalGenerator* gg = this->LocalGenerator->GetGlobalGenerator(); |