mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
itest: fix nil error deref
Here we fix a nil pointer panic that is caused by an 'err' var being deferenced before first checking that it is not nil. This was caused by an oversite in a refactor commit that was attempting to improve line length.
This commit is contained in:
parent
b720db59c6
commit
3852d3169e
1 changed files with 8 additions and 6 deletions
|
|
@ -1514,12 +1514,14 @@ func (hn *HarnessNode) Stop() error {
|
|||
// Close any attempts at further grpc connections.
|
||||
if hn.conn != nil {
|
||||
err := hn.conn.Close()
|
||||
isConnClosingErr := strings.Contains(
|
||||
err.Error(), "connection is closing",
|
||||
)
|
||||
if err != nil && !isConnClosingErr {
|
||||
return fmt.Errorf("error attempting to stop grpc "+
|
||||
"client: %v", err)
|
||||
if err != nil {
|
||||
if !strings.Contains(
|
||||
err.Error(), "connection is closing",
|
||||
) {
|
||||
|
||||
return fmt.Errorf("error attempting to "+
|
||||
"stop grpc client: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue