Do not dereference nullptr.

This commit is contained in:
Teo Mrnjavac 2016-12-13 12:16:12 +01:00 committed by Philip
parent 07de427aab
commit 026fa922d2

View File

@ -151,6 +151,12 @@ createNewEncryptedPartition( PartitionNode* parent,
FileSystemFactory::create( FileSystem::Luks, FileSystemFactory::create( FileSystem::Luks,
firstSector, firstSector,
lastSector ) ); lastSector ) );
if ( !fs )
{
qDebug() << "ERROR: cannot create LUKS filesystem. Giving up.";
return nullptr;
}
fs->createInnerFileSystem( fsType ); fs->createInnerFileSystem( fsType );
fs->setPassphrase( passphrase ); fs->setPassphrase( passphrase );
Partition* p = new Partition( parent, Partition* p = new Partition( parent,