Fix broken null check
This commit is contained in:
1 parent
7e2ab13400
commit
c8f3f8222f
1 file changed
+2
-2
@@ -36,7 +36,7 @@ let update_stats = async id => {
|
||||
}
|
||||
|
||||
const send_watch_command = () => {
|
||||
if (socket.readyState === WebSocket.OPEN) {
|
||||
if (socket !== null && socket.readyState === WebSocket.OPEN) {
|
||||
socket.send(
|
||||
JSON.stringify(
|
||||
{cmd: "watch_file", a1: file.id, a2: view_token}
|
||||
@@ -46,7 +46,7 @@ const send_watch_command = () => {
|
||||
}
|
||||
|
||||
const init_socket = () => {
|
||||
if (socket !== null || socket.readyState !== WebSocket.CLOSED) {
|
||||
if (socket !== null && socket.readyState !== WebSocket.CLOSED) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user