Subject: Re: bug#49248: 28.0.50; read-from-minibuffer returns a window-live-p error when its original window is deleted

From: martin rudalics <[email-masked]>
Date: Mon, 28 Jun 2021 09:53:22 +0200

> Wrong type argument: window-live-p, #<window 38>
 > (See backtrace in the link to helm issue mentionned above)

Can you try the attached.

martin
diff --git a/src/minibuf.c b/src/minibuf.c
index 00069eabbe..1b842b7721 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1210,7 +1210,7 @@ read_minibuf_unwind (void)
 		     WINDOW_FRAME (XWINDOW (minibuf_window))))
 	    Fset_frame_selected_window (selected_frame, prev, Qnil);
 	}
-      else
+      else if (WINDOW_LIVE_P (calling_window))
 	Fset_frame_selected_window (calling_frame, calling_window, Qnil);
     }