From 1b643ff55fe8dd2adc03589fdb1dfd5a461629b6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 21 Jul 2015 13:00:01 +0200 Subject: [PATCH] Handle empty values for ConfirmQuit conftype. --- qutebrowser/config/configtypes.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index d3f0b0d8d..c3daf5b25 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -1372,8 +1372,14 @@ class ConfirmQuit(List): def validate(self, value): values = self.transform(value) + if not value: + if self._none_ok: + return None + else: + raise configexc.ValidationError( + value, "Value may not be empty!") # Never can't be set with other options - if 'never' in values and len(values) > 1: + elif 'never' in values and len(values) > 1: raise configexc.ValidationError( value, "List cannot contain never!") # Always can't be set with other options