Commit 4ade5d1
committed
fix(ios): prevent crash in SQL syntax highlighter with stale range
The highlight method is called asynchronously from the text storage
delegate. By the time it executes, the text may have changed, making
the editedRange invalid (location beyond string length). Add bounds
check and clamp the range before calling lineRangeForRange.
Fixes crash: -[NSString lineRangeForRange:] out-of-bounds exception1 parent ecda976 commit 4ade5d1
1 file changed
Lines changed: 9 additions & 3 deletions
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | | - | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | | - | |
76 | | - | |
| 81 | + | |
| 82 | + | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
| |||
0 commit comments