Runestone icon indicating copy to clipboard operation
Runestone copied to clipboard

Thread 1: Fatal error: 85 is out of bounds. Valid range is 0 - 84.

Open Yyilin001 opened this issue 2 months ago • 1 comments

What happened?

Just quickly tap the keyboard to enter characters to reproduce。

What are the steps to reproduce?

Just quickly tap the keyboard to enter characters to reproduce。

What is the expected behavior?

Just quickly tap the keyboard to enter characters to reproduce。

Yyilin001 avatar Oct 20 '25 03:10 Yyilin001

func node(containingLocation location: NodeValue) -> Node? {
    guard location >= minimumValue && location <= root.nodeTotalValue else {
        #if DEBUG
        fatalError("\(location) is out of bounds. Valid range is \(minimumValue) - \(root.nodeTotalValue)."
                   + " This issue is under investigation. Please open an issue at https://github.com/simonbs/Runestone/issues"
                   + " and include this stack trace and a sample text file if possible. This fatal error is only thrown in debug builds.")
        #else
        return nil
        #endif
    }
    return node(containingLocation: location, minimumValue: minimumValue, valueKeyPath: \.value, totalValueKeyPath: \.nodeTotalValue)
}

Yyilin001 avatar Oct 20 '25 03:10 Yyilin001