Merge branch 'fix-segfault-invalid-host' of https://github.com/agimenez/bti into...
[gregoa/bti.git] / bti.c
diff --git a/bti.c b/bti.c
index 93b32a301bddadc15bbbd420060fba6753dc90ee..9fb5f5485c92be9ad52035800fd56840677a3d77 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -724,6 +724,11 @@ static int send_request(struct session *session)
                                free(req_url);
                }
 
+               if (!reply) {
+                       fprintf(stderr, "Error retrieving from URL (%s)\n", endpoint);
+                       return 1;
+               }
+
                if ((session->action != ACTION_UPDATE) &&
                                (session->action != ACTION_RETWEET))
                        parse_timeline(reply, session);