From 00ea284cbc9aa50ece64331c720ee508736c61d7 Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Sun, 2 Apr 2023 19:03:39 -0700 Subject: [PATCH] Nil is not an error, much less a serious one. --- cardsim/errors.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cardsim/errors.go b/cardsim/errors.go index 90ffdfb..c8d91a8 100644 --- a/cardsim/errors.go +++ b/cardsim/errors.go @@ -55,6 +55,9 @@ func Warningf(f string, args ...any) *Warning { // IsSeriousError returns whether e is a non-warning error. If e is nil, this // returns false. func IsSeriousError(e error) bool { + if e == nil { + return false + } return !errors.Is(e, AnyWarning) }