diff --git a/src/gui_interface.py b/src/gui_interface.py
index 439f9745d38a3ebabd7a867ea3e2cce1b8e18fab..b5761c5d450ea48446f41dcd94ef5a2aa7f107dd 100644
--- a/src/gui_interface.py
+++ b/src/gui_interface.py
@@ -268,11 +268,11 @@ class Interface:
             if gc_control.error_dialog:
                 gc_control.error_dialog.destroy()
 
-        gc_control.error_dialog = dialogs.InputDialog(_('Password Required'),
-            _('A Password is required to join the room %s. Please type it.') % \
-            room_jid, is_modal=False, ok_handler=on_ok,
-            cancel_handler=on_cancel)
-        gc_control.error_dialog.input_entry.set_visibility(False)
+            gc_control.error_dialog = dialogs.InputDialog(_('Password Required'),
+                _('A Password is required to join the room %s. Please type it.') % \
+                room_jid, is_modal=False, ok_handler=on_ok,
+                cancel_handler=on_cancel)
+            gc_control.error_dialog.input_entry.set_visibility(False)
 
     def handle_event_gc_presence(self, obj):
         gc_control = obj.gc_control