branch: elpa/emacsql commit 6728a8649ae0209094c8c4b9e9f5786c004ab2ae Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@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.")