summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-08-29 23:01:13 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-08-29 23:01:13 +0300
commite023c5c7823db3b4d853bc939b76d88001a51dc4 (patch)
treec0336595a01d69dd054fa1375b576f2659bf2d32 /src/ui/documentwidget.c
parentf98174e48a2334a97c3827c6b471534bf8c49718 (diff)
DocumentWidget: Crash on restore
Error page tries to access the non-existent request. It should actually be checking the contents of the cached response...
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 1c8a51c9..43b1664f 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -508,20 +508,22 @@ static void showErrorPage_DocumentWidget_(iDocumentWidget *d, enum iGmStatusCode
508 const iGmError *msg = get_GmError(code); 508 const iGmError *msg = get_GmError(code);
509 appendChar_String(src, msg->icon ? msg->icon : 0x2327); /* X in a box */ 509 appendChar_String(src, msg->icon ? msg->icon : 0x2327); /* X in a box */
510 appendFormat_String(src, " %s\n%s", msg->title, msg->info); 510 appendFormat_String(src, " %s\n%s", msg->title, msg->info);
511 switch (code) { 511 if (d->request) {
512 case failedToOpenFile_GmStatusCode: 512 switch (code) {
513 case certificateNotValid_GmStatusCode: 513 case failedToOpenFile_GmStatusCode:
514 appendFormat_String(src, "\n\n%s", cstr_String(meta_GmRequest(d->request))); 514 case certificateNotValid_GmStatusCode:
515 break; 515 appendFormat_String(src, "\n\n%s", cstr_String(meta_GmRequest(d->request)));
516 case unsupportedMimeType_GmStatusCode: 516 break;
517 appendFormat_String(src, "\n```\n%s\n```\n", cstr_String(meta_GmRequest(d->request))); 517 case unsupportedMimeType_GmStatusCode:
518 break; 518 appendFormat_String(src, "\n```\n%s\n```\n", cstr_String(meta_GmRequest(d->request)));
519 case slowDown_GmStatusCode: 519 break;
520 appendFormat_String(src, "\n\nWait %s seconds before your next request.", 520 case slowDown_GmStatusCode:
521 cstr_String(meta_GmRequest(d->request))); 521 appendFormat_String(src, "\n\nWait %s seconds before your next request.",
522 break; 522 cstr_String(meta_GmRequest(d->request)));
523 default: 523 break;
524 break; 524 default:
525 break;
526 }
525 } 527 }
526 setSource_DocumentWidget_(d, src); 528 setSource_DocumentWidget_(d, src);
527 resetSmoothScroll_DocumentWidget_(d); 529 resetSmoothScroll_DocumentWidget_(d);