Explorar el Código

Handle avatar file being empty

Tulir Asokan hace 3 años
padre
commit
2f26167c52
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      mautrix_signal/puppet.py

+ 2 - 0
mautrix_signal/puppet.py

@@ -238,6 +238,8 @@ class Puppet(DBPuppet, BasePuppet):
                 data = file.read()
         except FileNotFoundError:
             return False
+        if not data:
+            return False
         new_hash = hashlib.sha256(data).hexdigest()
         if self.avatar_set and new_hash == self.avatar_hash:
             return False