Skip to content

Commit 3255205

Browse files
authored
Merge pull request #741 from oasisprotocol/ptrus/bugfix/shutdown-panic
fix: Potential panic during shutdown
2 parents 7c4bf5a + 8333def commit 3255205

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/server.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,12 @@ func (srv *Web3Gateway) startRPC() error {
254254
}
255255

256256
func (srv *Web3Gateway) stopRPC() {
257-
srv.http.stop()
258-
srv.ws.stop()
257+
if srv.http != nil {
258+
srv.http.stop()
259+
}
260+
if srv.ws != nil {
261+
srv.ws.stop()
262+
}
259263
}
260264

261265
// Wait blocks until the server is closed.

0 commit comments

Comments
 (0)