Browse Source

Handle avatar file being empty

Tulir Asokan 3 năm trước cách đây
mục cha
commit
2f26167c52
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  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