From 8a6fdf8e18cffe7e9ee4fb4b9b1816fa049cbe63 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 22 Jun 2018 12:24:45 +0100 Subject: [PATCH] dell: Don't crash when the alternate device has not been set I don't think this is possible, but it's the right thing to do... --- plugins/dell/fu-plugin-dell.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/dell/fu-plugin-dell.c b/plugins/dell/fu-plugin-dell.c index 54a2873ef..c52b9f644 100644 --- a/plugins/dell/fu-plugin-dell.c +++ b/plugins/dell/fu-plugin-dell.c @@ -772,9 +772,14 @@ fu_plugin_unlock (FuPlugin *plugin, FuDevice *device, GError **error) g_debug ("Unlocking upgrades for: %s (%s)", fu_device_get_name (device), fu_device_get_id (device)); device_alt = fu_device_get_alternate (device); - - if (!device_alt) + if (device_alt == NULL) { + g_set_error (error, + FWUPD_ERROR, + FWUPD_ERROR_NOT_SUPPORTED, + "No alternate device for %s", + fu_device_get_name (device)); return FALSE; + } g_debug ("Preventing upgrades for: %s (%s)", fu_device_get_name (device_alt), fu_device_get_id (device_alt));