diff options
| author | Brian D. Caruso <bdc34@cornell.edu> | 2025-06-27 22:18:51 -0400 |
|---|---|---|
| committer | Gabriele Bozzola <9167485+Sbozzolo@users.noreply.github.com> | 2025-09-29 08:14:17 -0700 |
| commit | adf8d10212d15f9bd5ca62b96c7b423be02ce3c4 (patch) | |
| tree | 038e1dcf713ccb1e70f19b9eaf1dfc8ef6e74684 | |
| parent | d958e2de8db78bfd9c4ba3d4b0140a1b5860cb92 (diff) | |
Fixes segfault when clicking error in compilation-shell-minor-mode
| -rw-r--r-- | vterm-module.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vterm-module.c b/vterm-module.c index 2294ef4..17cf13e 100644 --- a/vterm-module.c +++ b/vterm-module.c @@ -209,8 +209,11 @@ static void fetch_cell(Term *term, int row, int col, VTermScreenCell *cell) { static char *get_row_directory(Term *term, int row) { if (row < 0) { ScrollbackLine *sbrow = term->sb_buffer[-row - 1]; - return sbrow->info->directory; - /* return term->dirs[0]; */ + if ( sbrow && sbrow->info && sbrow->info->directory ) { + return sbrow->info->directory; + } else { + return NULL; + } } else { LineInfo *line = term->lines[row]; return line ? line->directory : NULL; |
