From 6def9c4c4c06629e910eecf74f20959818d2edb5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mon, 4 May 2015 11:08:52 +0200 Subject: [PATCH] Be careful with the selection copied Make sure there was something selected before stripping it Fixes downstream bug: https://bugzilla.redhat.com/1209759 --- src/guake/guake_app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/guake/guake_app.py b/src/guake/guake_app.py index 725f39b18..4122109ae 100644 --- a/src/guake/guake_app.py +++ b/src/guake/guake_app.py @@ -440,9 +440,11 @@ def show_context_menu(self, terminal, event): if current_term.get_has_selection(): current_term.copy_clipboard() guake_clipboard = gtk.clipboard_get() - current_selection = guake_clipboard.wait_for_text().rstrip() + current_selection = guake_clipboard.wait_for_text() + if current_selection: + current_selection.rstrip() - if len(current_selection) > 20: + if current_selection and len(current_selection) > 20: current_selection = current_selection[:17] + "..." self.get_widget('separator_search').set_visible(False)