ProjectExplorer: Avoid a QTC_ASSERT for a legitimated situation

Change-Id: I07ce3a286e366c039497379f8bfd2a7be9523c75
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2023-08-29 12:25:23 +02:00
parent 5839a09e72
commit bd89cc1fd5

View File

@@ -427,8 +427,9 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_unique<DeviceManager
deviceHooks.deviceDisplayName = [](const FilePath &filePath) {
auto device = DeviceManager::deviceForPath(filePath);
QTC_ASSERT(device, return filePath.toUserOutput());
return device->displayName();
if (device)
return device->displayName();
return filePath.host().toString();
};
deviceHooks.ensureReachable = [](const FilePath &filePath, const FilePath &other) {