From 84780f56f441deb4ff736987986daeaf64db17a4 Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Fri, 7 Aug 2009 15:40:35 -0700 Subject: Don't crash if the Backup Manager returns a null RestoreSet[] --- cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'cmds/bmgr') 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) { -- cgit v1.1