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

Commit 783a4505 authored by Uwais Ashraf's avatar Uwais Ashraf
Browse files

Use correct int for accessing snapshots in array

Test: Manual
Bug: 334825222
Fix: 343611137
Flag: EXEMPT bugfix
Change-Id: Id128b357a123058efdd565cd4e61ad642c974229
parent a8d4e7e2
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -70,10 +70,10 @@ data class ThumbnailData(

        @JvmStatic
        fun wrap(taskIds: IntArray?, snapshots: Array<TaskSnapshot>?): HashMap<Int, ThumbnailData> {
            return if (taskIds == null || snapshots == null || taskIds.size != snapshots.size) {
                HashMap()
            } else {
                HashMap(taskIds.associateWith { taskId -> fromSnapshot(snapshots[taskId]) })
            return hashMapOf<Int, ThumbnailData>().apply {
                if (taskIds != null && snapshots != null && taskIds.size == snapshots.size) {
                    repeat(snapshots.size) { put(taskIds[it], fromSnapshot(snapshots[it])) }
                }
            }
        }