Don't cancel upload if server max size is unknown

This commit is contained in:
miruka 2020-07-19 16:24:16 -04:00
parent 2dbb155a22
commit e2c6f0e64c

View File

@ -1326,7 +1326,9 @@ class MatrixClient(nio.AsyncClient):
) -> UploadReturn:
"""Upload a file to the matrix homeserver."""
if filesize > self.models["accounts"][self.user_id].max_upload_size:
max_size = self.models["accounts"][self.user_id].max_upload_size
if max_size and filesize > max_size:
raise MatrixTooLarge()
mime = mime or await utils.guess_mime(data_provider(0, 0))