Do not dereference a nullptr.

main
Teo Mrnjavac 10 years ago
parent d96cfb725b
commit 845dd761d9

@ -172,14 +172,17 @@ void
PartitionCoreModule::createPartitionTable( Device* device, PartitionTable::TableType type ) PartitionCoreModule::createPartitionTable( Device* device, PartitionTable::TableType type )
{ {
DeviceInfo* info = infoForDevice( device ); DeviceInfo* info = infoForDevice( device );
// Creating a partition table wipes all the disk, so there is no need to if ( info )
// keep previous changes {
info->forgetChanges(); // Creating a partition table wipes all the disk, so there is no need to
// keep previous changes
info->forgetChanges();
PartitionModel::ResetHelper helper( partitionModelForDevice( device ) ); PartitionModel::ResetHelper helper( partitionModelForDevice( device ) );
CreatePartitionTableJob* job = new CreatePartitionTableJob( device, type ); CreatePartitionTableJob* job = new CreatePartitionTableJob( device, type );
job->updatePreview(); job->updatePreview();
info->jobs << Calamares::job_ptr( job ); info->jobs << Calamares::job_ptr( job );
}
refresh(); refresh();
} }

Loading…
Cancel
Save