Check that .metadata.yaml actually contains a dict

It might just be empty (= None) or a list or something.

Thanks @Kunsi for the heads-up.
This commit is contained in:
Gina Häußge 2017-07-28 12:01:36 +02:00
parent e508898564
commit ec55890c55

View file

@ -1353,8 +1353,9 @@ class LocalFileStorage(StorageInterface):
except:
self._logger.exception("Error while reading .metadata.yaml from {path}".format(**locals()))
else:
self._metadata_cache[path] = deepcopy(metadata)
return metadata
if isinstance(metadata, dict):
self._metadata_cache[path] = deepcopy(metadata)
return metadata
return dict()
def _save_metadata(self, path, metadata):