From 0eba0bbca0046e9a3cbbd84f2c688e8733e83e48 Mon Sep 17 00:00:00 2001 From: David Yang Date: Wed, 18 Dec 2024 11:33:59 +0800 Subject: [PATCH] Ensure content is not None before using it. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Phùng Xuân Anh --- guake/dialogs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guake/dialogs.py b/guake/dialogs.py index ae84a2601..9605d9bc1 100644 --- a/guake/dialogs.py +++ b/guake/dialogs.py @@ -149,7 +149,7 @@ def run(self): col = self.terminal.get_column_count() content = self.terminal.get_text_range(0, 0, row, col) - if content: + if content and content[0]: selection = content[0].rstrip().lstrip() else: # Call the original method if get_text_range fails for some reason. (Can it fail?) self.terminal.select_all()