From 146bce49321da3b65d0a0e0326bb54cf1e79551c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 24 Feb 2023 22:46:05 +0200 Subject: [PATCH] Avoid crashes in batch mode due to lack of frame face cache * src/xfaces.c (Finternal_merge_in_global_face): Handle frames with no face cache. --- src/xfaces.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xfaces.c b/src/xfaces.c index 62d7823f308..37b703984be 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -4186,7 +4186,9 @@ Default face attributes override any local face attributes. */) if (EQ (face, Qdefault)) { struct face_cache *c = FRAME_FACE_CACHE (f); - struct face *newface, *oldface = FACE_FROM_ID_OR_NULL (f, DEFAULT_FACE_ID); + struct face *newface; + struct face *oldface = + c ? FACE_FROM_ID_OR_NULL (f, DEFAULT_FACE_ID) : NULL; Lisp_Object attrs[LFACE_VECTOR_SIZE]; /* This can be NULL (e.g., in batch mode). */