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.
This commit is contained in:
Richard Hughes 2022-05-11 10:27:26 +01:00
parent 53e3ae340b
commit a826f0134a

View File

@ -371,9 +371,11 @@ fu_colorhug_device_setup(FuDevice *device, GError **error)
/* although guessing is a route to insanity, if the device has /* although guessing is a route to insanity, if the device has
* provided the extra data it's because the BCD type was not * provided the extra data it's because the BCD type was not
* suitable -- and INTEL_ME is not relevant here */ * suitable -- and INTEL_ME is not relevant here */
if (tmp != NULL) {
fu_device_set_version_format(device, fu_common_version_guess_format(tmp)); fu_device_set_version_format(device, fu_common_version_guess_format(tmp));
fu_device_set_version(device, tmp); fu_device_set_version(device, tmp);
} }
}
/* get GUID from the descriptor if set */ /* get GUID from the descriptor if set */
idx = g_usb_device_get_custom_index(usb_device, idx = g_usb_device_get_custom_index(usb_device,