From 7b2d3602745bb93d1b6e827861b9892c08ce2cf0 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Mon, 25 Mar 2024 19:37:01 +0800 Subject: [PATCH] by Robin at 20240325; nil --- library/taginterceptor/cryptoTagInterceptor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/taginterceptor/cryptoTagInterceptor.go b/library/taginterceptor/cryptoTagInterceptor.go index 37367921..5c843067 100644 --- a/library/taginterceptor/cryptoTagInterceptor.go +++ b/library/taginterceptor/cryptoTagInterceptor.go @@ -40,14 +40,14 @@ func (interceptor *CryptoTagInterceptor) Intercept(p any, tags ...string) (err e //开始遍历标签 for interceptor.cryptoEleQueue.Len() != 0 { ele := interceptor.cryptoEleQueue.Remove(interceptor.cryptoEleQueue.Front()) + if ele == nil { + continue + } cryptoElement, ok := ele.(*CryptoElement) if !ok { logger.Error("crypto element assertion failed, element is: %v, type is: %v", ele, reflect.TypeOf(ele).String()) continue } - if cryptoElement == nil { - continue - } if cryptoElement.eleType == StructPtr { // *struct if err = interceptor.parse(cryptoElement.eleValue.Interface(), tags...); err != nil {