From db0401147719ddd0e66d9b3a9bb9737776a9923f Mon Sep 17 00:00:00 2001 From: Pavel Patrin Date: Mon, 1 Jul 2024 15:52:50 +0200 Subject: [PATCH] Update invoker.go (#35) In addition to https://github.com/NVIDIA/gontainer/pull/34. Signed-off-by: Pavel Patrin --- invoker.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/invoker.go b/invoker.go index c7f60ec..7384beb 100644 --- a/invoker.go +++ b/invoker.go @@ -45,7 +45,8 @@ func (i *invoker) Invoke(fn any) (InvokeResult, error) { if index == len(fnOutArgs)-1 { // And type of the value is the error. if fnOut.Type().Implements(errorType) { - // Use the value as an error. Perform safe type conversion to avoid panics. + // Use the value as an error. + // Ignore failed cast of nil error. result.err, _ = fnOut.Interface().(error) } }