summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2020-01-11 14:51:36 -0600
committerMichael Catanzaro <mcatanzaro@gnome.org>2020-01-11 14:51:36 -0600
commitef0b4177b57fd6ed8d3b24467fa88703c0a6f279 (patch)
tree96a9ec787d59e01766ad2a56ccd45e8b5e9e1d66
parent7a4e510e5b4318522daaa07680bdb71976e5ee1a (diff)
downloadepiphany-mcatanzaro/sync-crash.tar.gz
sync: don't crash when message body is emptymcatanzaro/sync-crash
I started getting crashes here after I uninstalled glib-networking in my jhbuild environment.
-rw-r--r--lib/sync/ephy-sync-service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sync/ephy-sync-service.c b/lib/sync/ephy-sync-service.c
index 24f5f433d..35e2ccc87 100644
--- a/lib/sync/ephy-sync-service.c
+++ b/lib/sync/ephy-sync-service.c
@@ -919,6 +919,11 @@ get_signed_certificate_cb (SoupSession *session,
const char *message = NULL;
const char *certificate = NULL;
+ if (!msg->response_body || !msg->response_body->data) {
+ g_warning ("No response body");
+ goto out_error;
+ }
+
node = json_from_string (msg->response_body->data, &error);
if (error) {
g_warning ("Response is not a valid JSON: %s", error->message);