Skip to content

Commit

Permalink
Fix KeyError: 'Key Bindings' on category iteration
Browse files Browse the repository at this point in the history
This fixes an error with the tcd_browser.py module on a fresh install of **Ghidra 9.2.0 PUBLIC**.

```
Traceback (most recent call last):
  File "install.py", line 112, in <module>
    browser.update(preferences)
  File "/home/user/Development/personal/ghidra_themes/ghidra-dark/tcd_browser.py", line 47, in update
    for preference, option in preferences[category.get("NAME")].items():
KeyError: 'Key Bindings'
```
  • Loading branch information
tuxuser committed Nov 14, 2020
1 parent e9fe852 commit ed13300
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcd_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def update(self, preferences):
categories = [_ for _ in tool_options.iter() if _.tag == "CATEGORY" and "NAME" in _.attrib]

for category in categories:
for preference, option in preferences[category.get("NAME")].items():
for preference, option in preferences.get(category.get("NAME"), {}).items():
element = [_ for _ in category.iter() if _.get("NAME") == preference]

# Check if the preference exists or not
Expand Down

0 comments on commit ed13300

Please sign in to comment.