mirror of https://github.com/chzyer/readline.git
NewEx: fix panic if cfg.Painter is not given (#129)
This commit is contained in:
parent
c6c3e8d906
commit
aa9ed7db49
|
@ -161,6 +161,9 @@ func NewEx(cfg *Config) (*Instance, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
rl := t.Readline()
|
rl := t.Readline()
|
||||||
|
if cfg.Painter == nil {
|
||||||
|
cfg.Painter = &defaultPainter{}
|
||||||
|
}
|
||||||
return &Instance{
|
return &Instance{
|
||||||
Config: cfg,
|
Config: cfg,
|
||||||
Terminal: t,
|
Terminal: t,
|
||||||
|
|
Loading…
Reference in New Issue