diff --git a/gajim/common/modules/iq.py b/gajim/common/modules/iq.py
index 3e63068c2cbc86ff0d216918d1dd80da781bd749..4cffc02b8c51f00b85cc3f4cd40b8cf2b1f9cd4c 100644
--- a/gajim/common/modules/iq.py
+++ b/gajim/common/modules/iq.py
@@ -46,6 +46,7 @@ def _iq_error_received(self,
                            properties: IqProperties
                            ) -> None:
         self._log.info('Error: %s', properties.error)
+        assert properties.error is not None
         if properties.error.condition in ('jid-malformed',
                                           'forbidden',
                                           'not-acceptable'):
@@ -73,9 +74,9 @@ def _iq_error_received(self,
                 if file_props:
                     app.ged.raise_event(
                         FileSendError(account=self._account,
-                                    jid=str(properties.jid),
-                                    file_props=file_props,
-                                    error_msg=''))
+                                      jid=str(properties.jid),
+                                      file_props=file_props,
+                                      error_msg=''))
                     self._con.get_module('Bytestream').disconnect_transfer(
                         file_props)
                     raise nbxmpp.NodeProcessed