From aa29e64d77504a50cb8fe6ef5c7d2642170ea07f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 10 Oct 2012 21:29:57 +0200 Subject: [PATCH] Add a null check to the generator target accessor. --- Source/cmMakefile.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ac8381cc9..360b3d91d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4061,8 +4061,11 @@ bool cmMakefile::IsAlias(const char *name) //---------------------------------------------------------------------------- cmGeneratorTarget* cmMakefile::FindGeneratorTargetToUse(const char* name) { - cmTarget *t = this->FindTargetToUse(name); - return this->LocalGenerator->GetGlobalGenerator()->GetGeneratorTarget(t); + if (cmTarget *t = this->FindTargetToUse(name)) + { + return this->LocalGenerator->GetGlobalGenerator()->GetGeneratorTarget(t); + } + return 0; } //----------------------------------------------------------------------------