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:
Pascal Vizeli 2018-02-26 22:17:25 +01:00 committed by GitHub
parent da867ef8ef
commit ffe45d0d02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(