diff --git a/horde_sdk/ai_horde_api/ai_horde_clients.py b/horde_sdk/ai_horde_api/ai_horde_clients.py index e0f04d3..e8e77b1 100644 --- a/horde_sdk/ai_horde_api/ai_horde_clients.py +++ b/horde_sdk/ai_horde_api/ai_horde_clients.py @@ -611,7 +611,7 @@ def _do_request_with_check( tuple[HordeResponse, JobID]: The final response and the corresponding job ID. """ - if len(inspect.getfullargspec(check_callback).args) == 0: + if check_callback is not None and len(inspect.getfullargspec(check_callback).args) == 0: raise ValueError("Callback must take at least one argument") # This session class will cleanup incomplete requests in the event of an exception @@ -914,7 +914,7 @@ async def _do_request_with_check( AIHordeRequestError: If the request failed. The error response is included in the exception. """ - if len(inspect.getfullargspec(check_callback).args) == 0: + if check_callback is not None and len(inspect.getfullargspec(check_callback).args) == 0: raise ValueError("Callback must take at least one argument") context: contextlib.AbstractContextManager | AIHordeAPIAsyncClientSession