Skip to content

Commit

Permalink
check nil transactions (#1537)
Browse files Browse the repository at this point in the history
  • Loading branch information
baptiste-b-pegasys authored Oct 31, 2022
1 parent ab9f7fe commit 703f2a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,9 @@ func (m Message) WithEmptyPrivateData(b bool) Message {
}

func (tx *Transaction) IsPrivate() bool {
if tx == nil {
return false
}
v, _, _ := tx.RawSignatureValues()
if v == nil {
return false
Expand Down Expand Up @@ -675,7 +678,7 @@ func (tx *Transaction) SetPrivate() {
}

func (tx *Transaction) IsPrivacyMarker() bool {
return tx.To() != nil && *tx.To() == common.QuorumPrivacyPrecompileContractAddress()
return tx != nil && tx.To() != nil && *tx.To() == common.QuorumPrivacyPrecompileContractAddress()
}

// PrivacyMetadata encapsulates privacy information to be attached
Expand Down

0 comments on commit 703f2a0

Please sign in to comment.