From 4b4b8cce9ad0b980487dab65d227dd2c2e5f4f0b Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 6 Mar 2012 09:19:52 +0000 Subject: [PATCH] Guard against invalid colours. Closes LP#943251 --- terminatorlib/prefseditor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index 17ef7d8a..f38b89e1 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -367,7 +367,11 @@ class PrefsEditor: widget.set_active(self.config['cursor_blink']) # Cursor colour widget = guiget('cursor_color') - widget.set_color(gtk.gdk.Color(self.config['cursor_color'])) + try: + widget.set_color(gtk.gdk.Color(self.config['cursor_color'])) + except ValueError: + self.config['cursor_color'] = "#FFFFFF" + widget.set_color(gtk.gdk.Color(self.config['cursor_color'])) ## Command tab # Login shell