[partition] Avoid crash when there is no KPM backend
This commit is contained in:
parent
ede19c8a61
commit
3d0709c779
@ -112,6 +112,11 @@ QList< Device* >
|
|||||||
getDevices( DeviceType which )
|
getDevices( DeviceType which )
|
||||||
{
|
{
|
||||||
CoreBackend* backend = CoreBackendManager::self()->backend();
|
CoreBackend* backend = CoreBackendManager::self()->backend();
|
||||||
|
if ( !backend )
|
||||||
|
{
|
||||||
|
cWarning() << "No KPM backend found.";
|
||||||
|
return {};
|
||||||
|
}
|
||||||
#if defined( WITH_KPMCORE4API )
|
#if defined( WITH_KPMCORE4API )
|
||||||
DeviceList devices = backend->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag( 0 ) );
|
DeviceList devices = backend->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag( 0 ) );
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user