Skip to content

Commit

Permalink
Check if object is iterable before iterating it
Browse files Browse the repository at this point in the history
  • Loading branch information
Undo1 committed Jun 10, 2016
1 parent ab6f9b7 commit 10c6f45
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion metasmoke.py
Expand Up @@ -5,6 +5,7 @@
from globalvars import GlobalVars
import threading
import websocket
from collections import Iterable
import sys
import traceback

Expand All @@ -24,7 +25,7 @@ def init_websocket(self):
if "message" in data:
message = data['message']

if "message" in message:
if isinstance(message, Iterable) and "message" in message:
GlobalVars.charcoal_hq.send_message("{ [metasmoke](https://github.com/Charcoal-SE/metasmoke) } " + message['message'])
except Exception, e:
GlobalVars.metasmoke_ws = websocket.create_connection(GlobalVars.metasmoke_ws_host, origin=GlobalVars.metasmoke_host)
Expand Down

0 comments on commit 10c6f45

Please sign in to comment.