diff options
author | Jun Su <juns@nvidia.com> | 2014-04-25 14:18:29 +0800 |
---|---|---|
committer | Jun Su <juns@nvidia.com> | 2014-04-26 13:36:06 +0800 |
commit | bf427a2064e76cabc5e50573bcfcc0c954dd0720 (patch) | |
tree | 863da5feba8edaf998d510f2f7cc7cb3be1842c3 /src/com/android/settings/applications | |
parent | 4c941850288011ca29466a1a80314155c0100fe3 (diff) | |
download | packages_apps_Settings-bf427a2064e76cabc5e50573bcfcc0c954dd0720.zip packages_apps_Settings-bf427a2064e76cabc5e50573bcfcc0c954dd0720.tar.gz packages_apps_Settings-bf427a2064e76cabc5e50573bcfcc0c954dd0720.tar.bz2 |
Fix NullPointerException issue when user change
When info is null, we have risk to have access null point.
Change-Id: Ie6acee5c99d6297e31d46585435a735a38b19e82
Diffstat (limited to 'src/com/android/settings/applications')
-rw-r--r-- | src/com/android/settings/applications/RunningState.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/settings/applications/RunningState.java b/src/com/android/settings/applications/RunningState.java index 94ab11d..632b202 100644 --- a/src/com/android/settings/applications/RunningState.java +++ b/src/com/android/settings/applications/RunningState.java @@ -841,8 +841,10 @@ public class RunningState { info, context.getResources()); } String name = info != null ? info.name : null; - if (name == null) { + if (name == null && info != null) { name = Integer.toString(info.id); + } else if (info == null) { + name = context.getString(R.string.unknown); } userItem.mUser.mLabel = context.getResources().getString( R.string.running_process_item_user_label, name); |