Check for None Type

Signed-off-by: George Sibble <gsibble@gmail.com>
This commit is contained in:
George Sibble 2013-07-16 14:32:17 -07:00
parent 4d05b5d81f
commit 0628c63b15

View File

@ -159,7 +159,7 @@ class ApiClient:
instance = objClass() instance = objClass()
for attr, attrType in instance.swaggerTypes.iteritems(): for attr, attrType in instance.swaggerTypes.iteritems():
if attr in obj and type(obj) in [list, dict]: if obj is not None and attr in obj and type(obj) in [list, dict]:
value = obj[attr] value = obj[attr]
if attrType in ['str', 'int', 'long', 'float', 'bool']: if attrType in ['str', 'int', 'long', 'float', 'bool']:
attrType = eval(attrType) attrType = eval(attrType)