Skip to content

Commit 8eedd58

Browse files
committed
🐛 Add explicit checks for chunksize value
1 parent 54f6576 commit 8eedd58

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

discord/message.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ async def save(
314314
deleted attachments if too much time has passed, and it does not work
315315
on some types of attachments.
316316
chunksize: Optional[:class:`int`]
317-
The maximum size of each chunk to process.
317+
The maximum size of each chunk to process. Must be a positive non-null integer.
318318
319319
Returns
320320
-------
@@ -331,6 +331,8 @@ async def save(
331331
Argument `chunksize` is less than 1.
332332
"""
333333
if chunksize is not None:
334+
if chunksize < 1:
335+
raise InvalidArgument("chunksize must be a positive non-null integer.")
334336
data = self.read_chunked(use_cached=use_cached, chunksize=chunksize)
335337
else:
336338
data = await self.read(use_cached=use_cached)

0 commit comments

Comments
 (0)