emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/emacsql 6728a8649a 396/427: No longer try to clear a buffe


From: ELPA Syncer
Subject: [nongnu] elpa/emacsql 6728a8649a 396/427: No longer try to clear a buffer that isn't live anymore
Date: Tue, 13 Dec 2022 03:00:16 -0500 (EST)

branch: elpa/emacsql
commit 6728a8649ae0209094c8c4b9e9f5786c004ab2ae
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    No longer try to clear a buffer that isn't live anymore
    
    Re #62.
---
 emacsql.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/emacsql.el b/emacsql.el
index 7b93c4c819..e33badbeaa 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -149,8 +149,10 @@ MESSAGE should not have a newline on the end."
 
 (cl-defmethod emacsql-clear ((connection emacsql-connection))
   "Clear the process buffer for CONNECTION-SPEC."
-  (with-current-buffer (emacsql-buffer connection)
-    (erase-buffer)))
+  (let ((buffer (emacsql-buffer connection)))
+    (when (and buffer (buffer-live-p buffer))
+      (with-current-buffer buffer
+        (erase-buffer)))))
 
 (cl-defgeneric emacsql-waiting-p (connection)
   "Return non-nil if CONNECTION is ready for more input.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]