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:
Richard Hughes 2018-10-02 11:03:10 +01:00
parent 70ae1d59ed
commit 58bf3674e9

View File

@ -217,6 +217,12 @@ fu_device_list_find_by_id (FuDeviceList *self,
FuDeviceItem *item = NULL;
gsize device_id_len;
/* sanity check */
if (device_id == NULL) {
g_critical ("device ID was NULL");
return NULL;
}
/* support abbreviated hashes */
device_id_len = strlen (device_id);
fu_mutex_read_lock (self->devices_mutex);