The reproduced local log is following.
I confirmed the other thread entered the play function and set the player to nil while the crashed thread tried to unwrap the player.
ready
readyToPlay
loading
RxMusicPlayer/RxMusicPlayer.swift:577: Fatal error: Unexpectedly found nil while unwrapping an Optional value
2022-06-25 12:44:43.924432+0900 ExampleSwiftUI[82068:13633583] RxMusicPlayer/RxMusicPlayer.swift:577: Fatal error: Unexpectedly found nil while unwrapping an Optional value
The play function is called within ConcurrentDispatchQueueScheduler, so it can run concurrently.
It's critical to perform this blocking operation in the background thread, but it must be enough to run serially.
ref. https://github.com/yoheimuta/RxMusicPlayer/issues/21#issuecomment-860443895
The reproduced local log is following. I confirmed the other thread entered the play function and set the player to nil while the crashed thread tried to unwrap the player.
The play function is called within ConcurrentDispatchQueueScheduler, so it can run concurrently. It's critical to perform this blocking operation in the background thread, but it must be enough to run serially.