From e5b0141b0d7231426971763486b9cec0aac77a88 Mon Sep 17 00:00:00 2001
From: Juanma Barranquero <lekktu@gmail.com>
Date: Fri, 2 Dec 2022 14:14:26 +0100
Subject: [PATCH] Fix error editing multisession variables (bug#59710)

* lisp/emacs-lisp/multisession.el (multisession-edit-value):
Do not use `bound-and-true-p' on a non-symbol.  This reverts
commit bd586121ac21e046f60f75eeb0200866c38d6f9f.
---
 lisp/emacs-lisp/multisession.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/multisession.el b/lisp/emacs-lisp/multisession.el
index 9d6e8c0d88d..78d4137317d 100644
--- a/lisp/emacs-lisp/multisession.el
+++ b/lisp/emacs-lisp/multisession.el
@@ -447,8 +447,9 @@ storage method to list."
   (let* ((object (or
                   ;; If the multisession variable already exists, use
                   ;; it (so that we update it).
-                  (and (intern-soft (cdr id))
-                       (bound-and-true-p (intern (cdr id))))
+                  (if-let (sym (intern-soft (cdr id)))
+                      (and (boundp sym) (symbol-value sym))
+                    nil)
                   ;; Create a new object.
                   (make-multisession
                    :package (car id)
-- 
2.39.5