Avoid crash if we fail to resolve process in attach

llvm-svn: 185661
diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
index 4e8ed2f..6f25585 100644
--- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
+++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
@@ -135,6 +135,8 @@
                                            m_target.GetArchitecture(),
                                            exe_module_sp,
                                            executable_search_paths.GetSize() ? &executable_search_paths : NULL);
+    if (!error.Success())
+        return error;
 
     // Fix the target architecture if necessary
     const ArchSpec &module_arch = exe_module_sp->GetArchitecture();
@@ -144,9 +146,6 @@
     // Initialize the target module list
     m_target.SetExecutableModule (exe_module_sp, true);
 
-    if (!error.Success())
-        return error;
-
     SetSTDIOFileDescriptor(m_monitor->GetTerminalFD());
 
     SetID(pid);