Skip to content

Commit

Permalink
(fix): use .get() to avoid KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanVoxel committed Aug 9, 2024
1 parent ce87b11 commit 6ca902e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tagstudio/src/qt/modals/folders_to_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def add_folders_to_tree(items: list[str]) -> Tag:
library.add_tag_to_library(new_tag)
branch["dirs"][folder] = dict(dirs={}, tag=new_tag)
branch = branch["dirs"][folder]
return branch["tag"]
return branch.get("tag")

for tag in library.tags:
reversed_tag = reverse_tag(library, tag, None)
Expand Down

0 comments on commit 6ca902e

Please sign in to comment.