diff --git a/src/ops/restoreoperation.cpp b/src/ops/restoreoperation.cpp index 2862908..e94cbf4 100644 --- a/src/ops/restoreoperation.cpp +++ b/src/ops/restoreoperation.cpp @@ -64,11 +64,11 @@ RestoreOperation::RestoreOperation(Device& d, Partition* p, const QString& filen Partition* dest = targetDevice().partitionTable()->findPartitionBySector(restorePartition().firstSector(), PartitionRole(PartitionRole::Primary | PartitionRole::Logical | PartitionRole::Unallocated)); - Q_ASSERT(dest); - if (dest == nullptr) qWarning() << "destination partition not found at sector " << restorePartition().firstSector(); + Q_ASSERT(dest); + if (dest && !dest->roles().has(PartitionRole::Unallocated)) { restorePartition().setLastSector(dest->lastSector()); setOverwrittenPartition(dest);