Преглед изворни кода

Handle avatar file being empty

Tulir Asokan пре 3 година
родитељ
комит
2f26167c52
1 измењених фајлова са 2 додато и 0 уклоњено
  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