diff --git a/widgets/compose.go b/widgets/compose.go index db83a60..3bb334b 100644 --- a/widgets/compose.go +++ b/widgets/compose.go @@ -812,6 +812,9 @@ func (c *Composer) termEvent(event tcell.Event) bool { } func (c *Composer) termClosed(err error) { + if c.editor == nil { + return + } c.grid.RemoveChild(c.editor) c.review = newReviewMessage(c, err) c.grid.AddChild(c.review).At(3, 0) diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index a74d693..33b6e72 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -859,7 +859,9 @@ func (pv *PartViewer) Draw(ctx *ui.Context) { ctx.Printf(0, 0, style, "%s", pv.err.Error()) return } - pv.term.Draw(ctx) + if pv.term != nil { + pv.term.Draw(ctx) + } } func (pv *PartViewer) Cleanup() {