input/CdioParanoia: fix crash if no drive was found
cdio_get_devices_with_cap() can return nullptr if no drive was found, or it can instead return an empty list. The latter caused MPD to crash.
This commit is contained in:
@@ -176,6 +176,9 @@ cdio_detect_device()
|
||||
|
||||
AtScopeExit(devices) { cdio_free_device_list(devices); };
|
||||
|
||||
if (devices[0] == nullptr)
|
||||
return nullptr;
|
||||
|
||||
return AllocatedPath::FromFS(devices[0]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user