Skip to content

Commit 4a7c517

Browse files
authored
Merge pull request #233 from kkg4theweb/nounionmatchfix
2 parents 414d0ab + 15a755a commit 4a7c517

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dacite/core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _build_value_for_union(union: Type, data: Any, config: Config) -> Any:
134134
return value
135135
except DaciteError:
136136
pass
137-
if config.strict_unions_match:
137+
if config.strict_unions_match and union_matches:
138138
if len(union_matches) > 1:
139139
raise StrictUnionMatchError(union_matches)
140140
return union_matches.popitem()[1]

0 commit comments

Comments
 (0)