From 0ca53307d194a21cc85bb76bde75275c1aaca058 Mon Sep 17 00:00:00 2001 From: Christoph Breit Date: Mon, 29 Jun 2026 14:40:34 +0200 Subject: [PATCH] handle nil value in ExitError() --- exit.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exit.go b/exit.go index 76e3c78..4d70b5d 100644 --- a/exit.go +++ b/exit.go @@ -84,6 +84,9 @@ func BaseExit(rc Status) { // The Unknown state is used, since the plugin likely could not determine // the actual status of whatever was meant to be checked. func ExitError(err error) { + // Catches Panic if error is nil and outputs the full stacktrace + defer CatchPanic() + Exit(Unknown, fmt.Sprintf("%s (%T)", err.Error(), err)) }