Skip to content

Commit

Permalink
Fix empty client behavior with app-attached sandboxes
Browse files Browse the repository at this point in the history
Previously, if a clientless app was attached to a sandbox, it would
error with NoneType. This commit checks app._client to make sure it
exists before using it.
  • Loading branch information
pawalt committed Aug 27, 2024
1 parent ff533ee commit c936fbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modal/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ async def create(
_experimental_gpus=_experimental_gpus,
)
if client is None:
if app:
if app and app._client:
client = app._client
else:
client = await _Client.from_env()
Expand Down

0 comments on commit c936fbf

Please sign in to comment.