From 39d08eb9eb39c25b4536d787d1029e6c1ddf78e2 Mon Sep 17 00:00:00 2001 From: Brice Date: Fri, 17 Jul 2026 13:18:47 -0400 Subject: [PATCH] fix: prevent iOS crash when audio download fails in playFromUrl In TNSPlayer.playFromUrl, the NSURLSession completion handler rejects the promise when the download errors but does not return, so execution falls through to `SFBInputSource.inputSourceWithData(data)` with a null `data`, crashing on iOS. Return after reject so the handler bails out cleanly. --- src/audio/player.ios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/player.ios.ts b/src/audio/player.ios.ts index 5066f20..74224da 100644 --- a/src/audio/player.ios.ts +++ b/src/audio/player.ios.ts @@ -203,7 +203,7 @@ export class TNSPlayer extends Observable { if (this.errorCallback) { this.errorCallback({ error }); } - reject(error); + return reject(error); } const errorRef = new interop.Reference(); const inputSource = SFBInputSource.inputSourceWithData(data);