mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-27 02:56:31 +00:00
Bugfix if no data is given for encryption (#387)
* Bugfix if no data is given for encryption * Update snapshot.py
This commit is contained in:
parent
da867ef8ef
commit
ffe45d0d02
@ -151,7 +151,7 @@ class Snapshot(CoreSysAttributes):
|
||||
|
||||
def _encrypt_data(self, data):
|
||||
"""Make data secure."""
|
||||
if not self._key:
|
||||
if not self._key or data is None:
|
||||
return data
|
||||
|
||||
return b64encode(
|
||||
@ -159,7 +159,7 @@ class Snapshot(CoreSysAttributes):
|
||||
|
||||
def _decrypt_data(self, data):
|
||||
"""Make data readable."""
|
||||
if not self._key:
|
||||
if not self._key or data is None:
|
||||
return data
|
||||
|
||||
return Padding.unpad(
|
||||
|
Loading…
x
Reference in New Issue
Block a user