no-op on nil

This commit is contained in:
Dustin Brody 2022-03-04 21:07:17 +00:00
parent b455958d8a
commit 2d0a417844
No known key found for this signature in database
GPG Key ID: 3D7A11A0156519DC
1 changed files with 3 additions and 2 deletions

View File

@ -116,8 +116,9 @@ when useNews:
# TODO: This is a hack, because the table might be case sensitive. Ideally strtabs module has
# to be extended with case insensitive accessors.
headers["Origin"] = "http://localhost"
for header in client.getHeaders():
headers[header[0]] = header[1]
if not isNil(client.getHeaders):
for header in client.getHeaders():
headers[header[0]] = header[1]
client.transport = await newWebSocket(uri, headers)
client.uri = uri
client.loop = processData(client)