diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index 7b44d3d64..f54cca499 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -148,20 +148,23 @@ canBeResized( Partition* candidate ) ->globalStorage() ->value( "requiredStorageGiB" ) .toDouble( &ok ); + if ( !ok ) + { + cDebug() << Logger::SubEntry << "NO, requiredStorageGiB is not set correctly."; + return false; + } + // We require a little more for partitioning overhead and swap file double advisedStorageGB = requiredStorageGB + 0.5 + 2.0; qint64 availableStorageB = candidate->available(); - qint64 advisedStorageB = CalamaresUtils::GiBtoBytes( advisedStorageGB ); - if ( ok && - availableStorageB > advisedStorageB ) + if ( availableStorageB > advisedStorageB ) { cDebug() << "Partition" << convenienceName( candidate ) << "authorized for resize + autopartition install."; - return true; } - else if ( ok ) + else { Logger::CDebug deb; deb << Logger::SubEntry << "NO, insufficient storage"; @@ -173,11 +176,6 @@ canBeResized( Partition* candidate ) << "sectorsUsed:" << candidate->sectorsUsed() << "fsType:" << candidate->fileSystem().name(); return false; } - else - { - cDebug() << Logger::SubEntry << "NO, requiredStorageGB is not set correctly."; - return false; - } }