Browse Source

Return immediately if err getting gateway.

Bruce Marriner 9 years ago
parent
commit
9583ef4e19
1 changed files with 3 additions and 0 deletions
  1. 3 0
      wsapi.go

+ 3 - 0
wsapi.go

@@ -24,6 +24,9 @@ func (s *Session) Open() (err error) {
 
 	// Get the gateway to use for the Websocket connection
 	g, err := s.Gateway()
+	if err != nil {
+		return
+	}
 
 	// TODO: See if there's a use for the http response.
 	// conn, response, err := websocket.DefaultDialer.Dial(session.Gateway, nil)