Do not take address of a member of a NULL pointer. GitHub issue 1382

from Kamil Rytarowski.
This commit is contained in:
nicm 2018-06-26 11:14:05 +00:00
parent 0c94c3fbee
commit 8fb6666f17

View File

@ -2438,12 +2438,11 @@ void
window_copy_add_formats(struct window_pane *wp, struct format_tree *ft)
{
struct window_copy_mode_data *data = wp->modedata;
struct screen *s = &data->screen;
if (wp->mode != &window_copy_mode)
return;
format_add(ft, "selection_present", "%d", s->sel.flag);
format_add(ft, "selection_present", "%d", data->screen.sel.flag);
format_add(ft, "scroll_position", "%d", data->oy);
}