check if there actually is a partition in the partwidget before accessing it

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113935
This commit is contained in:
Volker Lanz 2010-04-12 10:15:30 +00:00
parent 72775ba8a0
commit f2e216cb43
1 changed files with 1 additions and 1 deletions

View File

@ -173,7 +173,7 @@ void PartitionManagerWidget::setSelectedPartition(const Partition* p)
Partition* PartitionManagerWidget::selectedPartition()
{
if (selectedDevice() == NULL || selectedDevice()->partitionTable() == NULL || partTableWidget().activeWidget() == NULL)
if (selectedDevice() == NULL || selectedDevice()->partitionTable() == NULL || partTableWidget().activeWidget() == NULL || partTableWidget().activeWidget()->partition() == NULL)
return NULL;
// The active partition we get from the part table widget is const; we need non-const.