From eecbe8eb36e18bdba843f83190ebf7704e2ad308 Mon Sep 17 00:00:00 2001 From: Lawliet-Chan <1576710154@qq.com> Date: Mon, 18 Nov 2024 14:24:26 +0800 Subject: [PATCH] fix nil pointer UnsignedTxnFromPb --- core/types/txn.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/types/txn.go b/core/types/txn.go index 0636266..5082d78 100644 --- a/core/types/txn.go +++ b/core/types/txn.go @@ -248,6 +248,12 @@ func (ut *UnsignedTxn) ToPb() *goproto.UnsignedTxn { } func UnsignedTxnFromPb(pb *goproto.UnsignedTxn) *UnsignedTxn { + if pb == nil { + return nil + } + if pb.WrCall == nil { + return nil + } return &UnsignedTxn{ WrCall: &WrCall{ ChainID: pb.WrCall.ChainId,