diff options
author | Christopher Tate <ctate@android.com> | 2009-08-07 15:40:35 -0700 |
---|---|---|
committer | Christopher Tate <ctate@android.com> | 2009-08-07 15:50:02 -0700 |
commit | 84780f56f441deb4ff736987986daeaf64db17a4 (patch) | |
tree | 8bfa903dfd7770403b27f0a2e4fdacc33fcd8e01 /cmds/bmgr | |
parent | b99ab30cbc98ec38d514bbd11197a6abf1c104b5 (diff) | |
download | frameworks_base-84780f56f441deb4ff736987986daeaf64db17a4.zip frameworks_base-84780f56f441deb4ff736987986daeaf64db17a4.tar.gz frameworks_base-84780f56f441deb4ff736987986daeaf64db17a4.tar.bz2 |
Don't crash if the Backup Manager returns a null RestoreSet[]
Diffstat (limited to 'cmds/bmgr')
-rw-r--r-- | cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java index a79d0cb..6b6d3c9 100644 --- a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java +++ b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java @@ -311,12 +311,14 @@ public final class Bmgr { return; } RestoreSet[] sets = mRestore.getAvailableRestoreSets(); - for (RestoreSet s : sets) { - if (s.token == token) { - System.out.println("Scheduling restore: " + s.name); - mRestore.performRestore(token, observer); - didRestore = true; - break; + if (sets != null) { + for (RestoreSet s : sets) { + if (s.token == token) { + System.out.println("Scheduling restore: " + s.name); + mRestore.performRestore(token, observer); + didRestore = true; + break; + } } } if (!didRestore) { |