Lagrange [release]

DocumentWidget: Crash after receiving a redirect

=> 334cb7d184132ed103395b7329c96b3c5fc99093

diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index b0b8fddd..f3c9ea82 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -1903,7 +1903,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
         return iFalse;
     }
     else if (equalWidget_Command(cmd, w, "document.request.finished") &&
-             pointerLabel_Command(cmd, "request") == d->request) {
+             d->request && pointerLabel_Command(cmd, "request") == d->request) {
         set_Block(&d->sourceContent, body_GmRequest(d->request));
         if (!isSuccess_GmStatusCode(status_GmRequest(d->request))) {
             format_String(&d->sourceHeader,
@@ -1918,7 +1918,8 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
         checkResponse_DocumentWidget_(d);
         init_Anim(&d->scrollY, d->initNormScrollY * size_GmDocument(d->doc).y);
         d->state = ready_RequestState;
-        /* The response may be cached. */ {
+        /* The response may be cached. */
+        if (d->request) {
             if (!equal_Rangecc(urlScheme_String(d->mod.url), "about") &&
                 startsWithCase_String(meta_GmRequest(d->request), "text/")) {
                 setCachedResponse_History(d->mod.history, lockResponse_GmRequest(d->request));
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/release/cdiff/334cb7d184132ed103395b7329c96b3c5fc99093
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
28.951701 milliseconds
Gemini-to-HTML Time
0.226618 milliseconds

This content has been proxied by September (ba2dc).