Empty path should yield nullptr Partition.

This commit is contained in:
Teo Mrnjavac 2016-03-10 12:43:00 +01:00
parent 24c1bf429e
commit 7d5795a6fd

View File

@ -83,6 +83,9 @@ findPartitionByMountPoint( const QList< Device* >& devices, const QString& mount
Partition* Partition*
findPartitionByPath( const QList< Device* >& devices, const QString& path ) findPartitionByPath( const QList< Device* >& devices, const QString& path )
{ {
if ( path.simplified().isEmpty() )
return nullptr;
for ( auto device : devices ) for ( auto device : devices )
for ( auto it = PartitionIterator::begin( device ); it != PartitionIterator::end( device ); ++it ) for ( auto it = PartitionIterator::begin( device ); it != PartitionIterator::end( device ); ++it )
if ( ( *it )->partitionPath() == path.simplified() ) if ( ( *it )->partitionPath() == path.simplified() )