浏览代码

BUG: LastError can return 0, so handle that case

Andy Cedilnik 22 年之前
父节点
当前提交
aef3ca6df8
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      Source/cmLoadCommandCommand.cxx

+ 6 - 2
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;
     }