mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-06 04:23:33 +00:00
trivial: Fix critical warning when reporting history against a broken server
This commit is contained in:
parent
bd60825749
commit
271f68b740
@ -733,6 +733,16 @@ fu_util_report_history_for_uri (FuUtilPrivate *priv,
|
||||
status_code = soup_session_send_message (priv->soup_session, msg);
|
||||
g_debug ("server returned: %s", msg->response_body->data);
|
||||
|
||||
/* server returned nothing, and probably exploded in a ball of flames */
|
||||
if (msg->response_body->length == 0) {
|
||||
g_set_error (error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_INVALID_FILE,
|
||||
"Failed to upload to %s: %s",
|
||||
report_uri, soup_status_get_phrase (status_code));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* parse JSON reply */
|
||||
json_parser = json_parser_new ();
|
||||
if (!json_parser_load_from_data (json_parser,
|
||||
|
Loading…
Reference in New Issue
Block a user