aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/crypto.go
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/crypto.go')
-rw-r--r--crypto/crypto.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/crypto.go b/crypto/crypto.go
index effa703d0..d56b9112f 100644
--- a/crypto/crypto.go
+++ b/crypto/crypto.go
@@ -92,7 +92,7 @@ func ToECDSAPub(pub []byte) *ecdsa.PublicKey {
}
func FromECDSAPub(pub *ecdsa.PublicKey) []byte {
- if pub == nil {
+ if pub == nil || pub.X == nil || pub.Y == nil {
return nil
}
return elliptic.Marshal(S256(), pub.X, pub.Y)