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

Commit 1d99674e authored by Yifan Hong's avatar Yifan Hong
Browse files

libsnapshot: Skip initializing snapshot if not created.

If no opeartions is to be executed on a partition, it is
possible that no snapshot is created for it. In that case,
don't crash when initalizing snapshots.

Test: libsnapshot_test
Change-Id: I7bb0b5596aa6e4eca319e9c88f6552d1907a6944
parent 55fb297a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1977,7 +1977,7 @@ bool SnapshotManager::InitializeUpdateSnapshots(
        }

        auto it = all_snapshot_status.find(target_partition->name());
        CHECK(it != all_snapshot_status.end()) << target_partition->name();
        if (it == all_snapshot_status.end()) continue;
        cow_params.partition_name = target_partition->name();
        std::string cow_name;
        if (!MapCowDevices(lock, cow_params, it->second, &created_devices_for_cow, &cow_name)) {