Fix NullPointerException issue when user change

When info is null, we have risk to have access null point.

Change-Id: Ie6acee5c99d6297e31d46585435a735a38b19e82
This commit is contained in:
Jun Su
2014-04-25 14:18:29 +08:00
parent 4c94185028
commit bf427a2064

View File

@@ -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);