mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-26 08:58:22 -04:00
[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
1 changed files with 5 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue