trivial: Fix a crash when flashing a thunderbolt controller in safe mode

This commit is contained in:
Richard Hughes 2017-01-11 17:21:10 +00:00
parent ccd78a9703
commit 26adb3c819

View File

@ -210,7 +210,8 @@ fu_plugin_thunderbolt_rescan (FuPlugin *plugin, GError **error)
for (guint i = 0; i < data->infos->len; i++) {
FuThunderboltInfo *info = g_ptr_array_index (data->infos, i);
if (info->controller == NULL) {
fu_plugin_device_remove (plugin, info->dev);
if (info->dev != NULL)
fu_plugin_device_remove (plugin, info->dev);
g_ptr_array_add (infos_remove, info);
}
}