mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-09 06:06:04 +00:00
trivial: Show a critical warning rather than crashing
Found when constructing devices manually in the self tests, it's not possible to hit this during normal runtime.
This commit is contained in:
parent
70ae1d59ed
commit
58bf3674e9
@ -217,6 +217,12 @@ fu_device_list_find_by_id (FuDeviceList *self,
|
|||||||
FuDeviceItem *item = NULL;
|
FuDeviceItem *item = NULL;
|
||||||
gsize device_id_len;
|
gsize device_id_len;
|
||||||
|
|
||||||
|
/* sanity check */
|
||||||
|
if (device_id == NULL) {
|
||||||
|
g_critical ("device ID was NULL");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* support abbreviated hashes */
|
/* support abbreviated hashes */
|
||||||
device_id_len = strlen (device_id);
|
device_id_len = strlen (device_id);
|
||||||
fu_mutex_read_lock (self->devices_mutex);
|
fu_mutex_read_lock (self->devices_mutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user