From a826f0134a897cce1a46519c0658d3dcf3a90b9c Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 11 May 2022 10:27:26 +0100 Subject: [PATCH] colorhug: Never set a NULL version when the FW inface data is NULL This fixes updating from ColorHug(1) devices on old firmware versions, but doesn't affect ColorHug2. --- plugins/colorhug/fu-colorhug-device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/colorhug/fu-colorhug-device.c b/plugins/colorhug/fu-colorhug-device.c index 813829e98..309afadbb 100644 --- a/plugins/colorhug/fu-colorhug-device.c +++ b/plugins/colorhug/fu-colorhug-device.c @@ -371,8 +371,10 @@ fu_colorhug_device_setup(FuDevice *device, GError **error) /* although guessing is a route to insanity, if the device has * provided the extra data it's because the BCD type was not * suitable -- and INTEL_ME is not relevant here */ - fu_device_set_version_format(device, fu_common_version_guess_format(tmp)); - fu_device_set_version(device, tmp); + if (tmp != NULL) { + fu_device_set_version_format(device, fu_common_version_guess_format(tmp)); + fu_device_set_version(device, tmp); + } } /* get GUID from the descriptor if set */