Set the context automatically when setting the device proxy

This commit is contained in:
Richard Hughes 2022-04-11 15:35:17 +01:00
parent 4795ab3122
commit f4fb625fba

View File

@ -1114,6 +1114,8 @@ fu_device_set_proxy(FuDevice *self, FuDevice *proxy)
/* copy from proxy */
if (proxy != NULL) {
if (fu_device_get_context(self) == NULL && fu_device_get_context(proxy) != NULL)
fu_device_set_context(self, fu_device_get_context(proxy));
if (fu_device_get_physical_id(self) == NULL &&
fu_device_get_physical_id(proxy) != NULL)
fu_device_set_physical_id(self, fu_device_get_physical_id(proxy));