summaryrefslogtreecommitdiff
path: root/Source/cmLoadCommandCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLoadCommandCommand.cxx')
-rw-r--r--Source/cmLoadCommandCommand.cxx8
1 files 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<std::string> 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;
}