File tree Expand file tree Collapse file tree
include/libremidi/backends/linux Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,15 +165,25 @@ inline udev_soundcard_info get_udev_soundcard_info(const udev_helper& helper, in
165165 entry = udev.list_entry_get_next (entry))
166166 {
167167 auto path = udev.list_entry_get_name (entry);
168+ if (!path)
169+ continue ;
170+
168171 auto dev = udev.device_new_from_syspath (helper.instance , path);
169- auto usb_device = udev.device_get_parent_with_subsystem_devtype (dev, " usb" , " usb_device" );
172+ if (!dev)
173+ continue ;
174+
175+ const auto usb_device
176+ = udev.device_get_parent_with_subsystem_devtype (dev, " usb" , " usb_device" );
177+
170178 port_information::port_type type = port_information::port_type::hardware;
171179 if (usb_device)
172180 type = (port_information::port_type)(type | port_information::port_type::usb);
173181 else
174182 type = (port_information::port_type)(type | port_information::port_type::pci);
175183
176184 auto id_path = udev.device_get_property_value (dev, " ID_PATH" );
185+ if (!id_path)
186+ id_path = " " ;
177187
178188 auto ret = udev_soundcard_info{.container = id_path, .path = path, .type = type};
179189 udev.device_unref (dev);
You can’t perform that action at this time.
0 commit comments