Prevented error when response doesn't have _items.
This commit is contained in:
@@ -33,7 +33,7 @@ class Project(List, Find, Create, Post, Update, Delete, Replace):
|
||||
|
||||
response = api.get(url)
|
||||
# Keep the response a dictionary, and cast it later into an object.
|
||||
if response['_items']:
|
||||
if response.get('_items'):
|
||||
item = utils.convert_datetime(response['_items'][0])
|
||||
return cls(item)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user