From 135feeb362ab7d0cecfe579f131f17d7a2e4220b Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 19 Sep 2023 07:08:18 +0800 Subject: [PATCH] Handle ios out of bounds issue --- .../Services/AudioSession/AudioController.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Services/AudioSession/AudioController.swift b/apple/OmnivoreKit/Sources/Services/AudioSession/AudioController.swift index 9cc80ba6b..888a2c249 100644 --- a/apple/OmnivoreKit/Sources/Services/AudioSession/AudioController.swift +++ b/apple/OmnivoreKit/Sources/Services/AudioSession/AudioController.swift @@ -411,13 +411,15 @@ currentItemOffset = max(currentItemOffset, 0) let idx = currentAudioIndex // item.speechItem.audioIdx - let currentItem = document?.utterances[idx].text ?? "" - let currentReadIndex = currentItem.index(currentItem.startIndex, offsetBy: min(currentItemOffset, currentItem.count)) - let lastItem = String(currentItem[..