Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a0fc877 authored by Chris Tate's avatar Chris Tate
Browse files

Don't crash bmgr if there are no available restore sets

Properly guard against a null set of available restore sets when
validating the token passed to 'bmgr restore TOKEN' against what's
known to exist on the backend.

Fixes bug 3153986

Change-Id: I74bdd4c6242f682833c1633baa4fefccb2b165a7
parent de407748
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -389,6 +389,7 @@ public final class Bmgr {
            if (err == 0) {
                observer.waitForCompletion();
                sets = observer.sets;
                if (sets != null) {
                    for (RestoreSet s : sets) {
                        if (s.token == token) {
                            System.out.println("Scheduling restore: " + s.name);
@@ -397,6 +398,7 @@ public final class Bmgr {
                        }
                    }
                }
            }
            if (!didRestore) {
                if (sets == null || sets.length == 0) {
                    System.out.println("No available restore sets; no restore performed");