Fix message encoding bug
- prevent loading invalid message types
This commit is contained in:
parent
96ea36cfd2
commit
3a8016d31f
|
@ -12,9 +12,10 @@ class MsgBase(object):
|
||||||
|
|
||||||
def constructObject(data):
|
def constructObject(data):
|
||||||
try:
|
try:
|
||||||
classBase = eval(data[""] + "." + data[""].title())
|
m = import_module("messagetypes." + data[""])
|
||||||
except NameError:
|
classBase = getattr(m, data[""].title())
|
||||||
logger.error("Don't know how to handle message type: \"%s\"", data[""])
|
except (NameError, ImportError):
|
||||||
|
logger.error("Don't know how to handle message type: \"%s\"", data[""], exc_info=True)
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
returnObj = classBase()
|
returnObj = classBase()
|
||||||
|
|
Reference in New Issue
Block a user