Skip to content

Commit

Permalink
Finally all tests pass syntactically!
Browse files Browse the repository at this point in the history
  • Loading branch information
tjprescott committed Dec 18, 2024
1 parent 8b00e8e commit 202a5f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/swift/SwiftAPIViewCore/Sources/Models/APIViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,12 @@ class APIViewModel: Tokenizable, Encodable {

/// Retrieves the last line from the review
func getLastLine() -> ReviewLine? {
guard let currentParent = self.currentParent ?? self.reviewLines.last else { return nil }
var current = currentParent.children.last
var current: ReviewLine? = nil
if let currentParent = self.currentParent {
current = currentParent.children.last
} else if let lastReviewLine = self.reviewLines.last {
current = lastReviewLine
}
if let lastChild = current?.children.last {
current = lastChild
}
Expand Down

0 comments on commit 202a5f9

Please sign in to comment.