diff --git a/pillarsdk/resource.py b/pillarsdk/resource.py index f416b9e..9d2a773 100644 --- a/pillarsdk/resource.py +++ b/pillarsdk/resource.py @@ -3,6 +3,7 @@ from datetime import datetime from . import utils from .api import Api +from .exceptions import ResourceNotFound class Resource(object): @@ -159,7 +160,7 @@ class Find(Resource): response = api.get(url) # Keep the response a dictionary, and cast it later into an object. - if response['_items']: + if '_items' in response: return cls(utils.convert_datetime(response['_items'][0])) else: raise ResourceNotFound(response)