From 19abb17bc08f3dbda1a040057f5dbd0d22d6e716 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Wed, 28 Oct 2009 22:15:46 +0100
Subject: [PATCH] fix traceback with bash completion

---
 src/groupchat_control.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/groupchat_control.py b/src/groupchat_control.py
index 68659aef1c..7e9c35afad 100644
--- a/src/groupchat_control.py
+++ b/src/groupchat_control.py
@@ -1844,8 +1844,8 @@ class GroupchatControl(ChatControlBase):
 				else:
 					add = ' '
 				start_iter = end_iter.copy()
-				if self.last_key_tabs and with_refer_to_nick_char or \
-				text[-1] == ' ':
+				if self.last_key_tabs and with_refer_to_nick_char or (text and \
+				text[-1] == ' '):
 					# have to accomodate for the added space from last
 					# completion
 					# gc_refer_to_nick_char may be more than one char!
-- 
GitLab