From aa9ed7db496e1e26f67e8f8acb0f419be1dfc4a5 Mon Sep 17 00:00:00 2001 From: Saeed Rasooli Date: Mon, 2 Oct 2017 14:46:29 +0800 Subject: [PATCH] NewEx: fix panic if cfg.Painter is not given (#129) --- readline.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readline.go b/readline.go index b654d44..b8ef811 100644 --- a/readline.go +++ b/readline.go @@ -161,6 +161,9 @@ func NewEx(cfg *Config) (*Instance, error) { return nil, err } rl := t.Readline() + if cfg.Painter == nil { + cfg.Painter = &defaultPainter{} + } return &Instance{ Config: cfg, Terminal: t,