<rdar://problem/11534686> 

Reading memory from a file when the section is encrypted doesn't show an error. No we do.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157484 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectMemory.cpp b/source/Commands/CommandObjectMemory.cpp
index c312816..6b495ac 100644
--- a/source/Commands/CommandObjectMemory.cpp
+++ b/source/Commands/CommandObjectMemory.cpp
@@ -613,8 +613,15 @@
             bytes_read = target->ReadMemory(address, false, data_sp->GetBytes (), data_sp->GetByteSize(), error);
             if (bytes_read == 0)
             {
-                result.AppendWarningWithFormat("Read from 0x%llx failed.\n", addr);
-                result.AppendError(error.AsCString());
+                const char *error_cstr = error.AsCString();
+                if (error_cstr && error_cstr[0])
+                {
+                    result.AppendError(error_cstr);
+                }
+                else
+                {
+                    result.AppendErrorWithFormat("failed to read memory from 0x%llx.\n", addr);
+                }
                 result.SetStatus(eReturnStatusFailed);
                 return false;
             }