Commit d216e74c authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

udev@drm: Acknowledge that udev_monitor_receive_device can return NULL

Do not build UDevDevice unless the device itself is valid.
parent 97b9e516
......@@ -306,7 +306,12 @@ UdevDevice::Ptr UdevMonitor::getDevice()
if (!m_monitor) {
return UdevDevice::Ptr();
return UdevDevice::Ptr(new UdevDevice(udev_monitor_receive_device(m_monitor)));
auto dev = udev_monitor_receive_device(m_monitor);
if (!dev) {
return {};
return UdevDevice::Ptr(new UdevDevice(dev));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment