First check, then assert.

This commit is contained in:
Teo Mrnjavac 2015-07-23 17:49:05 +02:00
parent cd0f5d8778
commit ac6591807a
1 changed files with 2 additions and 2 deletions

View File

@ -61,11 +61,11 @@ CopyOperation::CopyOperation(Device& targetdevice, Partition* copiedpartition, D
Partition* dest = targetDevice().partitionTable()->findPartitionBySector(copiedPartition().firstSector(), PartitionRole(PartitionRole::Primary | PartitionRole::Logical | PartitionRole::Unallocated));
Q_ASSERT(dest);
if (dest == nullptr)
qWarning() << "destination partition not found at sector " << copiedPartition().firstSector();
Q_ASSERT(dest);
if (dest && !dest->roles().has(PartitionRole::Unallocated)) {
copiedPartition().setLastSector(dest->lastSector());
setOverwrittenPartition(dest);