First check, then assert.
This commit is contained in:
parent
cd0f5d8778
commit
ac6591807a
|
@ -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));
|
Partition* dest = targetDevice().partitionTable()->findPartitionBySector(copiedPartition().firstSector(), PartitionRole(PartitionRole::Primary | PartitionRole::Logical | PartitionRole::Unallocated));
|
||||||
|
|
||||||
Q_ASSERT(dest);
|
|
||||||
|
|
||||||
if (dest == nullptr)
|
if (dest == nullptr)
|
||||||
qWarning() << "destination partition not found at sector " << copiedPartition().firstSector();
|
qWarning() << "destination partition not found at sector " << copiedPartition().firstSector();
|
||||||
|
|
||||||
|
Q_ASSERT(dest);
|
||||||
|
|
||||||
if (dest && !dest->roles().has(PartitionRole::Unallocated)) {
|
if (dest && !dest->roles().has(PartitionRole::Unallocated)) {
|
||||||
copiedPartition().setLastSector(dest->lastSector());
|
copiedPartition().setLastSector(dest->lastSector());
|
||||||
setOverwrittenPartition(dest);
|
setOverwrittenPartition(dest);
|
||||||
|
|
Loading…
Reference in New Issue