Don't crash when mountpoint is not found

findByPath may return a nullptr, in that case don't access it

BUG: 452100
This commit is contained in:
Nicolas Fella 2022-03-31 23:24:59 +02:00
parent a8966d230c
commit 1041b52c7a

View file

@ -45,7 +45,7 @@ QVariant PlacesDataSource::data()
auto storageAccess = device.as<Solid::StorageAccess>();
if (storageAccess) {
auto mountPoint = KMountPoint::currentMountPoints().findByPath(storageAccess->filePath());
if (!mountPoint->mountedFrom().startsWith(QLatin1String("kdeconnect@"))) {
if (mountPoint && !mountPoint->mountedFrom().startsWith(QLatin1String("kdeconnect@"))) {
hasSSHFS = true;
continue;
}