diff --git a/src/libcalamares/partition/PartitionSize.cpp b/src/libcalamares/partition/PartitionSize.cpp index edff0fe1e..5c4c0e040 100644 --- a/src/libcalamares/partition/PartitionSize.cpp +++ b/src/libcalamares/partition/PartitionSize.cpp @@ -153,6 +153,9 @@ PartitionSize::toBytes() const switch ( m_unit ) { + case unit_t::None: + case unit_t::Percent: + return -1; case unit_t::Byte: return value(); case unit_t::KiB: @@ -161,12 +164,7 @@ PartitionSize::toBytes() const return CalamaresUtils::MiBtoBytes( static_cast( value() ) ); case unit_t::GiB: return CalamaresUtils::GiBtoBytes( static_cast( value() ) ); - default: - break; } - - // Reached only when unit is Percent or None - return -1; } bool