First check, then assert.

This commit is contained in:
Teo Mrnjavac 2015-07-23 17:55:17 +02:00
parent ab049467b7
commit 504ac5a86c
1 changed files with 2 additions and 2 deletions

View File

@ -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);