Skip to content

Commit acf11bd

Browse files
committed
fix: don't access nil errors for empty reponses of certain CLN methods
1 parent 4aec969 commit acf11bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lnclient/cln/cln.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,7 @@ func (c *CLNService) SendPaymentSync(payReq string, amount *uint64) (*lnclient.P
17771777
return nil, fmt.Errorf("decode failed: %w", err)
17781778
}
17791779
if dec_resp == nil {
1780-
return nil, fmt.Errorf("decode result empty: %w", err)
1780+
return nil, fmt.Errorf("decode result empty")
17811781
}
17821782
if !dec_resp.Valid {
17831783
return nil, fmt.Errorf("payReq not valid")
@@ -1853,7 +1853,7 @@ func (c *CLNService) SignMessage(ctx context.Context, message string) (string, e
18531853
return "", fmt.Errorf("signmessage failed: %w", err)
18541854
}
18551855
if resp == nil {
1856-
return "", fmt.Errorf("signmessage result empty: %w", err)
1856+
return "", fmt.Errorf("signmessage result empty")
18571857
}
18581858

18591859
return resp.Zbase, nil
@@ -1876,7 +1876,7 @@ func (c *CLNService) UpdateChannel(ctx context.Context, updateChannelRequest *ln
18761876
return fmt.Errorf("setchannel failed: %w", err)
18771877
}
18781878
if resp == nil {
1879-
return fmt.Errorf("setchannel result empty: %w", err)
1879+
return fmt.Errorf("setchannel result empty")
18801880
}
18811881

18821882
return nil

0 commit comments

Comments
 (0)