Skip to content

Commit

Permalink
Fix a rare crash that can happen if the outline's internal state beco…
Browse files Browse the repository at this point in the history
…mes inconsistent
  • Loading branch information
vincode-io committed Sep 20, 2021
1 parent a846394 commit 56c90b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Templeton/Sources/Templeton/BaseRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ public class BaseRow: NSObject, NSCopying, OPMLImporter, Identifiable {
}

public func firstIndexOfRow(_ row: Row) -> Int? {
return rowOrder.firstIndex(of: row.id)
return rows.firstIndex(of: row)
}

public func containsRow(_ row: Row) -> Bool {
return rowOrder.contains(row.id)
return rows.contains(row)
}

public func insertRow(_ row: Row, at: Int) {
Expand Down
4 changes: 2 additions & 2 deletions Templeton/Sources/Templeton/Outline.swift
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,11 @@ public final class Outline: RowContainer, OPMLImporter, Identifiable, Equatable,
}

public func firstIndexOfRow(_ row: Row) -> Int? {
return rowOrder?.firstIndex(of: row.id)
return rows.firstIndex(of: row)
}

public func containsRow(_ row: Row) -> Bool {
return rowOrder?.contains(row.id) ?? false
return rows.contains(row)
}

public func insertRow(_ row: Row, at: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/microsoft/plcrashreporter.git",
"state": {
"branch": null,
"revision": "d747ab5de269cd44022bbe96ff9609d8626694ab",
"version": "1.9.0"
"revision": "59513acde6194d93617afcf7b2c81c88638a6af2",
"version": "1.10.0"
}
},
{
Expand Down

0 comments on commit 56c90b7

Please sign in to comment.