From 2c6f8de2cc79ec2aeade156c83611231f59cc6fd Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 26 Mar 2010 16:57:01 -0400 Subject: [PATCH] Fix for bug #0010466, fix crash in --help-module. --- Source/cmDocumentation.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index fc2fb14f55..1dfc784615 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -1177,11 +1177,18 @@ bool cmDocumentation::PrintDocumentationSingleModule(std::ostream& os) this->CurrentArgument.c_str(), *this->AllSections["Modules"])) { - this->PrintDocumentationCommand - (os, this->AllSections["Modules"]->GetEntries()[0]); - os << "\n Defined in: "; - os << moduleName << "\n"; - return true; + if(this->AllSections["Modules"]->GetEntries().size()) + { + this->PrintDocumentationCommand + (os, this->AllSections["Modules"]->GetEntries()[0]); + os << "\n Defined in: "; + os << moduleName << "\n"; + return true; + } + else + { + return false; + } } }