From aef3ca6df8d0f2b532adcfd140ad3cb1d5d0b35e Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Tue, 19 Aug 2003 10:29:59 -0400 Subject: [PATCH] BUG: LastError can return 0, so handle that case --- Source/cmLoadCommandCommand.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index b307148ab5..e5ef7ec722 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -205,8 +205,12 @@ bool cmLoadCommandCommand::InitialPass(std::vector const& args) if(!lib) { std::string err = "Attempt to load the library "; - err += fullPath + " failed. Additional error info is:\n"; - err += cmDynamicLoader::LastError(); + err += fullPath + " failed."; + if ( cmDynamicLoader::LastError() ) + { + err += " Additional error info is:\n"; + err += cmDynamicLoader::LastError(); + } this->SetError(err.c_str()); return false; }