trivial: Ensure the user called fwupd_client_set_user_agent() as asked

This commit is contained in:
Richard Hughes 2020-11-17 21:52:01 +00:00
parent 56fcdd2776
commit 02e7fb527a

View File

@ -1981,6 +1981,7 @@ fwupd_client_download_bytes (FwupdClient *self,
g_return_val_if_fail (url != NULL, NULL);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
g_return_val_if_fail (fwupd_client_get_user_agent (self) != NULL, NULL);
/* connect */
if (!fwupd_client_connect (self, cancellable, error))
@ -2030,6 +2031,7 @@ fwupd_client_download_file (FwupdClient *self,
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (fwupd_client_get_user_agent (self) != NULL, FALSE);
/* download then write */
bytes = fwupd_client_download_bytes (self, url, flags, cancellable, error);