Fix crash with -1 row indexes. Fix #4861.

This commit is contained in:
Brent Simmons committed 2025-12-04 09:38:21 -08:00
1 parent fcc35aecfc
commit ae575b73f1
1 file changed
+8 -2
@@ -118,7 +118,10 @@ extension Notification.Name {
func selectFeedsVisitor(node: Node) {
if let feedID = (node.representedObject as? SidebarItemIdentifiable)?.sidebarItemID {
if selectedFeedIdentifers.contains(feedID) {
selectIndexes.insert(outlineView.row(forItem: node) )
let row = outlineView.row(forItem: node)
if row >= 0 {
selectIndexes.insert(row)
}
}
}
}
@@ -154,7 +157,10 @@ extension Notification.Name {
func selectFeedsVisitor(node: Node) {
if let sidebarItemID = (node.representedObject as? SidebarItemIdentifiable)?.sidebarItemID {
if selectedFeedIdentifiers.contains(sidebarItemID) {
selectIndexes.insert(outlineView.row(forItem: node) )
let row = outlineView.row(forItem: node)
if row >= 0 {
selectIndexes.insert(row)
}
}
}
}