Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit c5f20ec0 authored by Sebastiano Barezzi's avatar Sebastiano Barezzi
Browse files

Twelve: ResumptionPlaylist: Don't die on no items

Change-Id: Id9c5528dfe9548f46a8efa6b955e70562f17a794
parent f8794663
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2024 The LineageOS Project
 * SPDX-FileCopyrightText: 2024-2025 The LineageOS Project
 * SPDX-License-Identifier: Apache-2.0
 */

@@ -18,6 +18,8 @@ data class ResumptionPlaylist(
    val startPositionMs: Long = 0L,
) {
    init {
        require(startIndex in mediaItemIds.indices) { "Invalid start index" }
        require(mediaItemIds.isEmpty() || startIndex in mediaItemIds.indices) {
            "Invalid start index"
        }
    }
}