home · contact · privacy
Fix empty input bug in curses client.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 12 Nov 2020 19:12:23 +0000 (20:12 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 12 Nov 2020 19:12:23 +0000 (20:12 +0100)
rogue_chat_curses.py

index e037e7d5943f3762ffc72f08952a4d0f20fcec67..acd6fa1719fb05a6329aeda2b81924419f65beb4 100755 (executable)
@@ -627,6 +627,8 @@ class TUI:
                 self.input_ = ""
                 self.switch_mode('play')
             elif self.mode == self.mode_chat and key == '\n':
+                if self.input_ == '':
+                    continue
                 if self.input_[0] == '/':  # FIXME fails on empty input
                     if self.input_ in {'/' + self.keys['switch_to_play'], '/play'}:
                         self.switch_mode('play')