Skip to content

Fix ConfigBase.get_item() raising KeyError for any falsey default#1000

Open
alentoghostflame wants to merge 1 commit into
gnome-terminator:masterfrom
alentoghostflame:plugin_get_falsey_fix
Open

Fix ConfigBase.get_item() raising KeyError for any falsey default#1000
alentoghostflame wants to merge 1 commit into
gnome-terminator:masterfrom
alentoghostflame:plugin_get_falsey_fix

Conversation

@alentoghostflame

Copy link
Copy Markdown

Currently, running ConfigBase.get_item() with any "falsey" default such as "", 0, False, etc. will result in a KeyError being raised. This alters the elif to specifically check if a value other than None is being provided as a default.

Not (currently) in this PR, but it might be worth using a custom sentinel value so None could also be used as a default value?

Signed-off-by: Alex Schoenhofen <alexanderschoenhofen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant