mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 01:15:38 -04: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/KPMHelpers.h"
|
||||||
#include "core/PartitionIterator.h"
|
#include "core/PartitionIterator.h"
|
||||||
|
|
||||||
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
// KPMcore
|
// KPMcore
|
||||||
#include <kpmcore/core/partition.h>
|
#include <kpmcore/core/partition.h>
|
||||||
#include <kpmcore/fs/luks.h>
|
#include <kpmcore/fs/luks.h>
|
||||||
|
@ -81,6 +83,12 @@ _findRootForPartition( PartitionNode* partition )
|
||||||
QColor
|
QColor
|
||||||
colorForPartition( Partition* partition )
|
colorForPartition( Partition* partition )
|
||||||
{
|
{
|
||||||
|
if ( !partition )
|
||||||
|
{
|
||||||
|
cWarning() << "NULL partition";
|
||||||
|
return FREE_SPACE_COLOR;
|
||||||
|
}
|
||||||
|
|
||||||
if ( KPMHelpers::isPartitionFreeSpace( partition ) )
|
if ( KPMHelpers::isPartitionFreeSpace( partition ) )
|
||||||
return FREE_SPACE_COLOR;
|
return FREE_SPACE_COLOR;
|
||||||
if ( partition->roles().has( PartitionRole::Extended ) )
|
if ( partition->roles().has( PartitionRole::Extended ) )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue