mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-19 20:32:35 +02:00
fix: nil panic when formatting error
This commit is contained in:
parent
56850a9580
commit
e1bc6d1f44
1 changed files with 3 additions and 3 deletions
|
@ -73,7 +73,7 @@ var spaces = []byte(" ")
|
|||
type appendLineFunc func(buf []byte, err error, level int) []byte
|
||||
|
||||
func (err *nestedError) Error() string {
|
||||
if err == nil {
|
||||
if err.Err == nil {
|
||||
return nilError.Error()
|
||||
}
|
||||
buf := appendLineNormal(nil, err.Err, 0)
|
||||
|
@ -85,7 +85,7 @@ func (err *nestedError) Error() string {
|
|||
}
|
||||
|
||||
func (err *nestedError) Plain() []byte {
|
||||
if err == nil {
|
||||
if err.Err == nil {
|
||||
return appendLinePlain(nil, nilError, 0)
|
||||
}
|
||||
buf := appendLinePlain(nil, err.Err, 0)
|
||||
|
@ -97,7 +97,7 @@ func (err *nestedError) Plain() []byte {
|
|||
}
|
||||
|
||||
func (err *nestedError) Markdown() []byte {
|
||||
if err == nil {
|
||||
if err.Err == nil {
|
||||
return appendLineMd(nil, nilError, 0)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue