Skip to content

Commit e1c98f9

Browse files
committed
Fix potential crash
1 parent b9662c0 commit e1c98f9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Tool/Sources/SuggestionBasic/EditorInformation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public struct EditorInformation: Sendable {
2323
public var lineAnnotations: [LineAnnotation]
2424

2525
public var selectedContent: String {
26+
guard !lines.isEmpty else { return "" }
2627
if let range = selections.first {
2728
if range.isEmpty { return "" }
2829
let startIndex = min(

0 commit comments

Comments
 (0)