Skip to content

Commit 08cb349

Browse files
committed
ActionCable: avoid potential nil error
1 parent 0df0947 commit 08cb349

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

actioncable/lib/action_cable/connection/web_socket.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ def possible?
1919
end
2020

2121
def alive?
22-
websocket && websocket.alive?
22+
websocket&.alive?
2323
end
2424

2525
def transmit(data)
26-
websocket.transmit data
26+
websocket&.transmit data
2727
end
2828

2929
def close(code = nil, reason = nil)
30-
websocket.close code, reason
30+
websocket&.close code, reason
3131
end
3232

3333
def protocol
34-
websocket.protocol
34+
websocket&.protocol
3535
end
3636

3737
def rack_response
38-
websocket.rack_response
38+
websocket&.rack_response
3939
end
4040

4141
private

0 commit comments

Comments
 (0)