Fix a possible crash when handling mouse clicks

This commit is contained in:
Kovid Goyal 2021-06-12 13:03:47 +05:30
parent 750cf7ad20
commit 1da2344aa3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2167,6 +2167,7 @@ screen_detect_url(Screen *screen, unsigned int x, unsigned int y) {
bool has_url = false;
index_type url_start, url_end = 0;
Line *line = screen_visual_line(screen, y);
if (!line || x >= screen->columns) return false;
if (line->cpu_cells[x].hyperlink_id) {
screen_mark_hyperlink(screen, x, y);
return true;