Check if fileSystem pointer is nullptr before trying to read used space

Hopefully it fixes the following crashes as well:
BUG: 364863
BUG: 365872
This commit is contained in:
Andrius Štikonas 2016-11-07 17:45:22 +00:00
parent f948569fef
commit 4ed3ce6267
1 changed files with 3 additions and 0 deletions

View File

@ -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();