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

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

[nongnu] elpa/subed 5fd2009 055/389: subed-mpv: Handle invalid JSON


From: ELPA Syncer
Subject: [nongnu] elpa/subed 5fd2009 055/389: subed-mpv: Handle invalid JSON
Date: Fri, 3 Dec 2021 10:59:56 -0500 (EST)

branch: elpa/subed
commit 5fd20096647b812e97f332127808894c0d0235df
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>

    subed-mpv: Handle invalid JSON
---
 subed/subed-mpv.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/subed/subed-mpv.el b/subed/subed-mpv.el
index a537c78..02426a5 100644
--- a/subed/subed-mpv.el
+++ b/subed/subed-mpv.el
@@ -199,8 +199,10 @@ CMD to `subed-mpv--client-command-queue' which is 
evaluated by
   (let* ((json-data (condition-case err
                         (json-read-from-string json-string)
                       (error
-                       (subed-debug "Unable to parse JSON response:\n%S" 
json-string))))
-         (event (alist-get 'event json-data)))
+                       (subed-debug "Unable to parse JSON response:\n%S" 
json-string)
+                       nil)))
+         (event (when json-data
+                  (alist-get 'event json-data))))
     (when event
       (subed-mpv--handle-event json-data))))
 



reply via email to

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