branch: externals/inspector
commit e5cc60aecd7b847356900df3bb1e440c499cbc2c
Author: Daanturo <daant...@gmail.com>
Commit: Daanturo <daant...@gmail.com>

    Fix corner case inspector--temp-buffer is killed
    
    When the said variable is non-nil but is a kill buffer, operations that
    use it will raise an error.
---
 inspector.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/inspector.el b/inspector.el
index 39d14723f7..f7fe059af4 100644
--- a/inspector.el
+++ b/inspector.el
@@ -241,9 +241,10 @@ See: `inspector--with-inspector-temp-buffer'.")
 
 (defun inspector--get-inspector-temp-buffer ()
   "Return a (cached) inspector temporary buffer."
-  (or inspector--temp-buffer
-      (setq inspector--temp-buffer
-            (get-buffer-create "*inspector-temp*"))))
+  (unless (buffer-live-p inspector--temp-buffer)
+    (setq inspector--temp-buffer
+          (get-buffer-create "*inspector-temp*")))
+  inspector--temp-buffer)
 
 (defun inspector--print-truncated (object &optional limit)
   "Print OBJECT to a string, truncated.

Reply via email to