<rdar://problem/12524810>

Fixed a crasher where if an invalid SBTarget was passed to:

lldb::addr_t
SBAddress::GetLoadAddress (const SBTarget &target) const;

We would crash.

llvm-svn: 166439
diff --git a/lldb/source/API/SBAddress.cpp b/lldb/source/API/SBAddress.cpp
index 6013fd3..f3e0d78 100644
--- a/lldb/source/API/SBAddress.cpp
+++ b/lldb/source/API/SBAddress.cpp
@@ -119,10 +119,13 @@
 
     lldb::addr_t addr = LLDB_INVALID_ADDRESS;
     TargetSP target_sp (target.GetSP());
-    if (m_opaque_ap.get())
+    if (target_sp)
     {
-        Mutex::Locker api_locker (target_sp->GetAPIMutex());
-        addr = m_opaque_ap->GetLoadAddress (target_sp.get());
+        if (m_opaque_ap.get())
+        {
+            Mutex::Locker api_locker (target_sp->GetAPIMutex());
+            addr = m_opaque_ap->GetLoadAddress (target_sp.get());
+        }
     }
     
     if (log)