]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle nil top frame (bug#76410)
authorGerd Möllmann <gerd.moellmann@gmail.com>
Wed, 19 Feb 2025 07:05:56 +0000 (08:05 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 20 Feb 2025 21:43:03 +0000 (22:43 +0100)
* src/frame.c (do_switch_frame): Don't assume that top_frame is always a
frame, it can be nil.

(cherry picked from commit 1194ebe3a71f97b0ce7c8dcc4edaf7b0f81fdc6f)

src/frame.c

index 5cf4f308ea5d01dc9a95679b974c976de8687ab9..d1c37f4e72270b4cd3a10783f809d115c15d68db 100644 (file)
@@ -1807,7 +1807,7 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
 
       /* When FRAME's root frame is not its terminal's top frame, make
         that root frame the new top frame of FRAME's terminal.  */
-      if (root_frame (f) != XFRAME (top_frame))
+      if (NILP (top_frame) || root_frame (f) != XFRAME (top_frame))
        {
          struct frame *p = FRAME_PARENT_FRAME (f);