summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2015-03-25 16:38:37 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2015-03-25 16:38:37 (GMT)
commita4a1b729c63ec81037af06ac1009d12cc1dc3188 (patch)
tree3b96b876cb9d9ddc9d2fd3b0a8c339fa49cbc5a8 /Source/cmMakefile.cxx
parent51b4321e5fdf9f7cbc54881037a45a474883ef47 (diff)
downloadCMake-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.cxx8
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();