From 4ed3ce626708b01dff652bda384ca9a5562a0212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Mon, 7 Nov 2016 17:45:22 +0000 Subject: [PATCH] Check if fileSystem pointer is nullptr before trying to read used space Hopefully it fixes the following crashes as well: BUG: 364863 BUG: 365872 --- src/core/partition.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/partition.cpp b/src/core/partition.cpp index ebb62a4..d888697 100644 --- a/src/core/partition.cpp +++ b/src/core/partition.cpp @@ -176,6 +176,9 @@ QString Partition::deviceNode() const /** @return the sectors used in the Partition's FileSystem or, in case of an extended partition, the sum of used sectors of the Partition's children */ qint64 Partition::sectorsUsed() const { + if (m_FileSystem == nullptr) + return -1; + if (!roles().has(PartitionRole::Extended)) return fileSystem().sectorsUsed();