Hi all, I'm fairly new to Swift and SwiftUI and am currently trying to build a trello app for macOS. things have been mostly fine so far, but now I am trying to understand why my app crashes when you switch between boards with an Index out of range error:
Swift/ContiguousArrayBuffer.swift:575: Fatal error: Index out of range
2022-10-18 13:16:30.178158+0200 trello[21927:17216201] Swift/ContiguousArrayBuffer.swift:575: Fatal error: Index out of range
It happens when any list in the new board has fewer cards (items) than in the old board The app always crashes in an onReceive that monitors an update to the card (so that I can do things like change a cards background color when a new label is applied or other things) I've tried using both the swiftui List directly or a ForEach, i'm just not sure what I am doing wrong
I have created a branch with the minimal code that seems to be causing issues on my repo:
how can I resolve this problem?