diff --git a/src/commonMain/kotlin/cinterop/mpv/MpvClientImpl.kt b/src/commonMain/kotlin/cinterop/mpv/MpvClientImpl.kt index 1a0a429..35639b9 100644 --- a/src/commonMain/kotlin/cinterop/mpv/MpvClientImpl.kt +++ b/src/commonMain/kotlin/cinterop/mpv/MpvClientImpl.kt @@ -197,7 +197,9 @@ abstract class MpvClientImpl(headless: Boolean = true): LibMpvClient(headless) { } override fun removeItem(index: Int) { - require(index >= 0) + if (index !in 0 until item_count) { + return + } val original_item_index: Int = current_item_index runCommand("playlist-remove", index)