[partition] Avoid crash when there is no KPM backend

This commit is contained in:
Adriaan de Groot 2021-08-31 13:46:25 +02:00
parent ede19c8a61
commit 3d0709c779

View File

@ -112,6 +112,11 @@ QList< Device* >
getDevices( DeviceType which )
{
CoreBackend* backend = CoreBackendManager::self()->backend();
if ( !backend )
{
cWarning() << "No KPM backend found.";
return {};
}
#if defined( WITH_KPMCORE4API )
DeviceList devices = backend->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag( 0 ) );
#else