Skip to content

Commit ec960f2

Browse files
authored
(fix): use .get() to avoid KeyError (#347)
1 parent ce87b11 commit ec960f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tagstudio/src/qt/modals/folders_to_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def add_folders_to_tree(items: list[str]) -> Tag:
6161
library.add_tag_to_library(new_tag)
6262
branch["dirs"][folder] = dict(dirs={}, tag=new_tag)
6363
branch = branch["dirs"][folder]
64-
return branch["tag"]
64+
return branch.get("tag")
6565

6666
for tag in library.tags:
6767
reversed_tag = reverse_tag(library, tag, None)

0 commit comments

Comments
 (0)