Calling save before load would crash Lovelace storage (#20368)

This commit is contained in:
Paulus Schoutsen 2019-01-23 21:13:55 -08:00 committed by GitHub
parent af3afb673a
commit 5580bec1d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View file

@ -101,6 +101,8 @@ class LovelaceStorage:
async def async_save(self, config):
"""Save config."""
if self._data is None:
self._data = {'config': None}
self._data['config'] = config
await self._store.async_save(self._data)