From 845dd761d97ab244b6f04f06906d7c19547e637a Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Sun, 21 Jun 2015 01:27:02 +0200 Subject: [PATCH] Do not dereference a nullptr. --- .../partition/core/PartitionCoreModule.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/modules/partition/core/PartitionCoreModule.cpp b/src/modules/partition/core/PartitionCoreModule.cpp index 2950d1a2b..b6398767b 100644 --- a/src/modules/partition/core/PartitionCoreModule.cpp +++ b/src/modules/partition/core/PartitionCoreModule.cpp @@ -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(); }