aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/compose.go3
-rw-r--r--widgets/msgviewer.go4
2 files changed, 6 insertions, 1 deletions
diff --git a/widgets/compose.go b/widgets/compose.go
index db83a608..3bb334b7 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 a74d693f..33b6e729 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() {