Skip to content

Commit

Permalink
Merge pull request #1355 from doronz88/bugfix/start-tunnel-no-tunnel
Browse files Browse the repository at this point in the history
tunneld: Fix `/start-tunnel` request to only return valid tunnels
  • Loading branch information
doronz88 authored Feb 10, 2025
2 parents 70c8b4e + 4ff1fde commit 96e70d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pymobiledevice3/tunneld/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ def generate_http_response(
@self._app.get('/start-tunnel')
async def start_tunnel(
udid: str, ip: Optional[str] = None, connection_type: Optional[str] = None) -> fastapi.Response:
udid_tunnels = [t.tunnel for t in self._tunneld_core.tunnel_tasks.values() if t.udid == udid]
udid_tunnels = [t.tunnel for t in self._tunneld_core.tunnel_tasks.values() if
t.udid == udid and t.tunnel is not None]
if len(udid_tunnels) > 0:
data = {
'interface': udid_tunnels[0].interface,
Expand Down

0 comments on commit 96e70d9

Please sign in to comment.