]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid crashes in batch mode due to lack of frame face cache
authorEli Zaretskii <eliz@gnu.org>
Fri, 24 Feb 2023 20:46:05 +0000 (22:46 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 24 Feb 2023 20:46:05 +0000 (22:46 +0200)
* src/xfaces.c (Finternal_merge_in_global_face): Handle frames
with no face cache.

src/xfaces.c

index 62d7823f30841c1f3d6f5cae33919d534738828a..37b703984bea0810bac30b3a06045d10b5905397 100644 (file)
@@ -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).  */