selected_match can become 0 when pressing certain scrolling keybindings without any match, and for i = first_match_to_print, last_match_to_print do in populate_log_with_matches() runs from 0 to 0 and accessing matches[0].text crashes console.lua. Return early when it is 0.
Unified · Split
| @@ -363,7 +363,7 @@ local function fuzzy_find(needle, haystacks) · 362 unmodified lines | ||
| 363 | 363 | end |
| 364 | 364 | |
| 365 | 365 | local function populate_log_with_matches(max_width) |
| 366 | − if not selectable_items then | |
| 366 | + if not selectable_items or selected_match == 0 then | |
| 367 | 367 | return |
| 368 | 368 | end |
| 369 | 369 | |