From 26adb3c8192643b045c8093ca438733e447da3ab Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 11 Jan 2017 17:21:10 +0000 Subject: [PATCH] trivial: Fix a crash when flashing a thunderbolt controller in safe mode --- plugins/thunderbolt/fu-plugin-thunderbolt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/thunderbolt/fu-plugin-thunderbolt.c b/plugins/thunderbolt/fu-plugin-thunderbolt.c index eb85bed98..edc97ad50 100644 --- a/plugins/thunderbolt/fu-plugin-thunderbolt.c +++ b/plugins/thunderbolt/fu-plugin-thunderbolt.c @@ -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); } }