Skip to content

Commit 0302f74

Browse files
committed
proof: avoid nil pointer panic in UniverseRpcCourier
It appears that the underlying library may `nil` out the `rawConn` after the transfer is finished. We can avoid a panic here by only closing if the `rawConn` is non-nil.
1 parent 317559c commit 0302f74

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

proof/courier.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,11 @@ func (c *UniverseRpcCourier) publishSubscriberEvent(event fn.Event) {
14731473

14741474
// Close closes the courier's connection to the remote gRPC service.
14751475
func (c *UniverseRpcCourier) Close() error {
1476-
return c.rawConn.Close()
1476+
if c.rawConn != nil {
1477+
return c.rawConn.Close()
1478+
}
1479+
1480+
return nil
14771481
}
14781482

14791483
// A compile-time assertion to ensure the UniverseRpcCourier meets the

0 commit comments

Comments
 (0)