From 026fa922d25a94e96c821b5278996d4e3d2f6de0 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Tue, 13 Dec 2016 12:16:12 +0100 Subject: [PATCH] Do not dereference nullptr. --- src/modules/partition/core/KPMHelpers.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/partition/core/KPMHelpers.cpp b/src/modules/partition/core/KPMHelpers.cpp index 52187d305..b0038213c 100644 --- a/src/modules/partition/core/KPMHelpers.cpp +++ b/src/modules/partition/core/KPMHelpers.cpp @@ -151,6 +151,12 @@ createNewEncryptedPartition( PartitionNode* parent, FileSystemFactory::create( FileSystem::Luks, firstSector, lastSector ) ); + if ( !fs ) + { + qDebug() << "ERROR: cannot create LUKS filesystem. Giving up."; + return nullptr; + } + fs->createInnerFileSystem( fsType ); fs->setPassphrase( passphrase ); Partition* p = new Partition( parent,