From 2ac268b7449c09c3c0f8eeac3b491e66ee328b65 Mon Sep 17 00:00:00 2001 From: Valeriy Gorelov Date: Mon, 10 Jun 2024 16:29:24 +0300 Subject: [PATCH] Fix Exception.Error() output when e.val is nil and e is not --- runtime.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime.go b/runtime.go index 0139ef10..6dff451c 100644 --- a/runtime.go +++ b/runtime.go @@ -386,11 +386,13 @@ func (e *Exception) String() string { } func (e *Exception) Error() string { - if e == nil || e.val == nil { + if e == nil { return "" } var b bytes.Buffer - b.WriteString(e.val.String()) + if e.val != nil { + b.WriteString(e.val.String()) + } e.writeShortStack(&b) return b.String() }