Skip to content

Commit eca8ec7

Browse files
(fix): none type base models are not unpacked
1 parent b105f1a commit eca8ec7

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

poetry.lock

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/elevenlabs/core/unchecked_base_model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,10 @@ def construct_type(*, type_: typing.Type[typing.Any], object_: typing.Any) -> ty
165165
return _convert_union_type(type_, object_)
166166

167167
# Cannot do an `issubclass` with a literal type, let's also just confirm we have a class before this call
168-
if not pydantic_v1.typing.is_literal_type(type_) and (
169-
inspect.isclass(base_type) and issubclass(base_type, pydantic_v1.BaseModel)
168+
if (
169+
object_ is not None
170+
and not pydantic_v1.typing.is_literal_type(type_)
171+
and (inspect.isclass(base_type) and issubclass(base_type, pydantic_v1.BaseModel))
170172
):
171173
return type_.construct(**object_)
172174

0 commit comments

Comments
 (0)