summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitsuru Oshima <oshima@google.com>2009-06-12 15:50:03 -0700
committerMitsuru Oshima <oshima@google.com>2009-06-12 15:52:53 -0700
commit12172baa6b72a8996b3f043f18067c9b43ed3bc8 (patch)
tree78a97271227320ea014c709dc346835c8713d901
parent8eb241b877d78cb665e99c6412876ebb1e5c0939 (diff)
downloadframeworks_base-12172baa6b72a8996b3f043f18067c9b43ed3bc8.zip
frameworks_base-12172baa6b72a8996b3f043f18067c9b43ed3bc8.tar.gz
frameworks_base-12172baa6b72a8996b3f043f18067c9b43ed3bc8.tar.bz2
* component can be null after destory?
This was causing NPE in catch block, which hides the actual exception.
-rw-r--r--core/java/android/app/ActivityThread.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index d08fc11..2fe6471 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -31,6 +31,7 @@ import android.content.pm.InstrumentationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ServiceInfo;
+import android.content.pm.PackageParser.Component;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -3286,10 +3287,10 @@ public final class ActivityThread {
throw e;
} catch (Exception e) {
if (!mInstrumentation.onException(r.activity, e)) {
+ ComponentName component = r.intent.getComponent();
+ String name = component == null ? "[Unknown]" : component.toShortString();
throw new RuntimeException(
- "Unable to destroy activity "
- + r.intent.getComponent().toShortString()
- + ": " + e.toString(), e);
+ "Unable to destroy activity " + name + ": " + e.toString(), e);
}
}
}