From: Alan Third Date: Thu, 22 Oct 2020 18:47:17 +0000 (+0100) Subject: Fix crash when no face is defined (bug#44058, bug#43973) X-Git-Tag: emacs-28.0.90~5476 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=87239f0a5c613dc716328e129bf79b69979b8a12;p=emacs.git Fix crash when no face is defined (bug#44058, bug#43973) * src/nsterm.m (ns_clear_under_internal_border): If face is null, don't try drawing anything. --- diff --git a/src/nsterm.m b/src/nsterm.m index a702a051d00..fa38350a2f6 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3048,6 +3048,12 @@ ns_clear_under_internal_border (struct frame *f) if (!face) face = FRAME_DEFAULT_FACE (f); + /* Sometimes with new frames we reach this point and have no + face. I'm not sure why we have a live frame but no face, so + just give up. */ + if (!face) + return; + ns_focus (f, &frame_rect, 1); [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set]; for (int i = 0; i < 4 ; i++)