From 5a3e96b17c2a948ac952295962dc6e281ec5cad5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 23 Nov 2019 15:47:28 -0800 Subject: [PATCH] Add eassert check for bad default face * src/xdisp.c (append_space_for_newline): Add an eassert check that default_face is not null, by calling FACE_FROM_ID instead of FACE_FROM_ID_OR_NULL. Initialize a local only if needed. --- src/xdisp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 593aaa73ac9..2b4dda27157 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21395,12 +21395,12 @@ append_space_for_newline (struct it *it, bool default_face_p) { const int local_default_face_id = lookup_basic_face (it->w, it->f, DEFAULT_FACE_ID); - struct face* default_face = - FACE_FROM_ID_OR_NULL (it->f, local_default_face_id); #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (it->f)) { + struct face *default_face + = FACE_FROM_ID (it->f, local_default_face_id); struct font *font = (default_face->font ? default_face->font : FRAME_FONT (it->f)); -- 2.39.5