Skip to content

Commit a708f2d

Browse files
authored
fix: Remove empty _client attribute in _json property (#999)
* fix: Remove empty _client attribute in _json property * refactor: conditional logic
1 parent eb3c7d3 commit a708f2d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

interactions/api/models/attrs_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ def __init__(self, kwargs_dict: dict = None, /, **other_kwargs):
4747
discord_name = attrib_name
4848

4949
if (value := kwargs.pop(discord_name, MISSING)) is not MISSING:
50-
if value is not None and attrib.metadata.get("add_client"):
50+
if (
51+
value is not None
52+
and attrib.metadata.get("add_client")
53+
and client is not None
54+
):
5155
if isinstance(value, list):
5256
for item in value:
5357
if isinstance(item, dict):

0 commit comments

Comments
 (0)