Skip to content

Commit

Permalink
Silence unable to decrypt warning for handshake responses (#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti authored Apr 10, 2021
1 parent 88533e9 commit 5fc57d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion miio/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ def _decode(self, obj, context, path):
decrypted = Utils.decrypt(obj, context["_"]["token"])
decrypted = decrypted.rstrip(b"\x00")
except Exception:
_LOGGER.debug("Unable to decrypt, returning raw bytes: %s", obj)
if obj:
_LOGGER.debug("Unable to decrypt, returning raw bytes: %s", obj)
return obj

# list of adaption functions for malformed json payload (quirks)
Expand Down

0 comments on commit 5fc57d1

Please sign in to comment.