[PATCH] Fix a crash when filesystem==nullptr.
authorFabio Bas <ctrlaltca@gmail.com>
Tue, 22 Apr 2025 12:40:33 +0000 (14:40 +0200)
committerAurélien COUDERC <coucouf@debian.org>
Mon, 9 Jun 2025 07:01:20 +0000 (09:01 +0200)
(cherry picked from commit 458ef81f2e424f13cdea44d2d89b8260b463e34e)

Co-authored-by: Andrius Štikonas <andrius@stikonas.eu>
Gbp-Pq: Name upstream_98838306_Fix-a-crash-when-filesystem-nullptr-.patch

src/plugins/sfdisk/sfdiskbackend.cpp

index e47c4e58b9fe2270aeedac34c64c8e0317e14032..447c096bb69e111cdbb6169f38799cb782e78392 100644 (file)
@@ -515,6 +515,8 @@ bool SfdiskBackend::updateDevicePartitionTable(Device &d, const QJsonObject &jso
 */
 void SfdiskBackend::readSectorsUsed(const Device& d, Partition& p, const QString& mountPoint)
 {
+    if (p.isFileSystemNullptr())
+        return;
     if (!mountPoint.isEmpty() && p.fileSystem().type() != FileSystem::Type::LinuxSwap && p.fileSystem().type() != FileSystem::Type::Lvm2_PV) {
         const QStorageInfo storage = QStorageInfo(mountPoint);
         if (p.isMounted() && storage.isValid())