[partition] Reduce scope for nullptr dereference
- document what types are in use - avoid at least one nullptr deref
This commit is contained in:
parent
1660e15eda
commit
e0a79f4c0f
@ -946,9 +946,12 @@ PartitionCoreModule::revertDevice( Device* dev, bool individualRevert )
|
||||
m_deviceModel->swapDevice( dev, newDev );
|
||||
|
||||
QList< Device* > devices;
|
||||
for ( auto info : m_deviceInfos )
|
||||
for ( DeviceInfo* const info : m_deviceInfos )
|
||||
{
|
||||
if ( info->device.data()->type() != Device::Type::Disk_Device )
|
||||
// device is a QScopedPointer
|
||||
if ( !info || info->device.isNull() )
|
||||
continue;
|
||||
if ( info->device->type() != Device::Type::Disk_Device )
|
||||
continue;
|
||||
else
|
||||
devices.append( info->device.data() );
|
||||
|
Loading…
Reference in New Issue
Block a user