mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
[partition] Complain loudly on dangling Partition pointers
- Don't crash if a bad pointer gets into colorutils.
This commit is contained in:
parent
2bc95d11d3
commit
353e713f81
1 changed files with 8 additions and 0 deletions
|
@ -22,6 +22,8 @@
|
|||
#include "core/KPMHelpers.h"
|
||||
#include "core/PartitionIterator.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
|
||||
// KPMcore
|
||||
#include <kpmcore/core/partition.h>
|
||||
#include <kpmcore/fs/luks.h>
|
||||
|
@ -81,6 +83,12 @@ _findRootForPartition( PartitionNode* partition )
|
|||
QColor
|
||||
colorForPartition( Partition* partition )
|
||||
{
|
||||
if ( !partition )
|
||||
{
|
||||
cWarning() << "NULL partition";
|
||||
return FREE_SPACE_COLOR;
|
||||
}
|
||||
|
||||
if ( KPMHelpers::isPartitionFreeSpace( partition ) )
|
||||
return FREE_SPACE_COLOR;
|
||||
if ( partition->roles().has( PartitionRole::Extended ) )
|
||||
|
|
Loading…
Add table
Reference in a new issue