From 7e3cd48284a79782f3725769113e3879c8bf3aef Mon Sep 17 00:00:00 2001 From: Azareal Date: Wed, 19 Feb 2020 08:43:55 +1000 Subject: [PATCH] fix attachment deletion crash bug Reduce bits of common bits in theme stylesheets. --- routes/attachments.go | 4 +++- themes/nox/public/main.css | 12 ++++++------ themes/shadow/public/main.css | 13 ++++++------- themes/tempra_simple/public/main.css | 8 ++++---- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/routes/attachments.go b/routes/attachments.go index 02c48e0a..acf4ff9c 100644 --- a/routes/attachments.go +++ b/routes/attachments.go @@ -92,8 +92,10 @@ func deleteAttachment(w http.ResponseWriter, r *http.Request, user c.User, aid i err := c.DeleteAttachment(aid) if err == sql.ErrNoRows { return c.NotFoundJSQ(w, r, nil, js) + } else if err != nil { + return c.InternalErrorJSQ(err, w, r, js) } - return c.InternalErrorJSQ(err, w, r, js) + return nil } // TODO: Stop duplicating this code diff --git a/themes/nox/public/main.css b/themes/nox/public/main.css index b18aacc1..e2d88d28 100644 --- a/themes/nox/public/main.css +++ b/themes/nox/public/main.css @@ -258,12 +258,12 @@ li a { } h1, h2, h3, h4, h5 { - -webkit-margin-before: 0; - -webkit-margin-after: 0; - margin-block-start: 0; - margin-block-end: 0; - margin-top: 0px; - margin-bottom: 0px; + -webkit-margin-before:0; + -webkit-margin-after:0; + margin-block-start:0; + margin-block-end:0; + margin-top:0; + margin-bottom:0; font-weight: normal; white-space: nowrap; } diff --git a/themes/shadow/public/main.css b/themes/shadow/public/main.css index 2eff2fad..f827ac66 100644 --- a/themes/shadow/public/main.css +++ b/themes/shadow/public/main.css @@ -163,7 +163,6 @@ a { .rowblock:not(.opthead):not(.colstack_head):not(.rowhead) .rowitem { font-size: 15px; /*16px*/ } - .rowblock:last-child, .colstack_item:last-child { padding-bottom: 10px; } @@ -179,12 +178,12 @@ a { display: inline; } h1, h2, h3, h4, h5 { - -webkit-margin-before: 0; - -webkit-margin-after: 0; - margin-block-start: 0; - margin-block-end: 0; - margin-top: 0px; - margin-bottom: 0px; + -webkit-margin-before:0; + -webkit-margin-after:0; + margin-block-start:0; + margin-block-end:0; + margin-top:0; + margin-bottom:0; font-weight: normal; } .rowsmall { diff --git a/themes/tempra_simple/public/main.css b/themes/tempra_simple/public/main.css index 4ff2f622..aecf2aeb 100644 --- a/themes/tempra_simple/public/main.css +++ b/themes/tempra_simple/public/main.css @@ -264,10 +264,10 @@ main > *:last-child { margin-left: 4px; } h1, h2, h3, h4, h5 { - -webkit-margin-before: 0; - -webkit-margin-after: 0; - margin-block-start: 0; - margin-block-end: 0; + -webkit-margin-before:0; + -webkit-margin-after:0; + margin-block-start:0; + margin-block-end:0; font-weight: normal; }