Do not dereference a nullptr.

This commit is contained in:
Teo Mrnjavac 2015-06-21 01:27:02 +02:00
parent d96cfb725b
commit 845dd761d9

View File

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