mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 02:45:44 -05:00
[partition] More conservative handling of device pointers
- thanks @abucodonosor
This commit is contained in:
parent
a6edb3ed34
commit
6316173f1b
1 changed files with 6 additions and 2 deletions
|
@ -165,9 +165,13 @@ PartitionPage::updateButtons()
|
|||
|
||||
if ( m_ui->deviceComboBox->currentIndex() >= 0 )
|
||||
{
|
||||
Device* device = nullptr;
|
||||
QModelIndex deviceIndex = m_core->deviceModel()->index( m_ui->deviceComboBox->currentIndex(), 0 );
|
||||
auto device = m_core->deviceModel()->deviceForIndex( deviceIndex );
|
||||
if ( device->type() != Device::Type::LVM_Device )
|
||||
if ( deviceIndex.isValid() )
|
||||
device = m_core->deviceModel()->deviceForIndex( deviceIndex );
|
||||
if ( !device )
|
||||
cWarning() << "Device for updateButtons is nullptr";
|
||||
else if ( device->type() != Device::Type::LVM_Device )
|
||||
{
|
||||
createTable = true;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue