Fix bug #3055578 ("adb shell bmgr list sets" generates NPE and cannot be run again when device has no account setup)

- fix NPE
- code cleaning

Change-Id: Ieb30b666d995de8cbd27ee6d17e2178e7ea670f6
This commit is contained in:
Fabrice Di Meglio
2010-10-01 11:16:10 -07:00
parent f01a873029
commit 04686f4289

View File

@@ -34,7 +34,6 @@ public final class Bmgr {
private String[] mArgs;
private int mNextArg;
private String mCurArgData;
public static void main(String[] args) {
try {
@@ -274,6 +273,10 @@ public final class Bmgr {
}
private void printRestoreSets(RestoreSet[] sets) {
if (sets == null || sets.length == 0) {
System.out.println("No restore sets");
return;
}
for (RestoreSet s : sets) {
System.out.println(" " + Long.toHexString(s.token) + " : " + s.name);
}