Commit 7e58238a authored by ryanss's avatar ryanss
Browse files

Fix exception caused by get_entry/entries not finding any results

parent 38c78f8d
......@@ -60,6 +60,9 @@ class API:
obj = SugarObject()
obj.module = module
for key in result['name_value_list']:
if isinstance(key, dict):
# No object found
return None
setattr(obj, key, result['name_value_list'][key]['value'])
return obj
......@@ -74,6 +77,9 @@ class API:
obj = SugarObject()
obj.module = module
for key in result['name_value_list']:
if isinstance(key, dict):
# No objects found
return []
setattr(obj, key, result['name_value_list'][key]['value'])
ret.append(obj)
return ret
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment