diff --git a/cloudkitty/state.py b/cloudkitty/state.py index 44c5a9ea..18e4975e 100644 --- a/cloudkitty/state.py +++ b/cloudkitty/state.py @@ -116,7 +116,9 @@ class DBStateManager(object): def get_metadata(self): """Get metadata attached to the state.""" - return json.loads(self._db.get_metadata(self._state_name)) + data = self._db.get_metadata(self._state_name) + if data: + return json.loads(data) def set_metadata(self, metadata): """Set metadata attached to the state."""