[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dtache 8bc68c1080 1/3: Update dtache--session-directory
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dtache 8bc68c1080 1/3: Update dtache--session-directory-event |
Date: |
Fri, 28 Jan 2022 11:57:30 -0500 (EST) |
branch: externals/dtache
commit 8bc68c10806c62659bafc92e859da11dfc7b7025
Author: Niklas Eklund <niklas.eklund@zenseact.com>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Update dtache--session-directory-event
Use when-let instead of let in order to capture the edge case when
dtache--db-get-session for an id returns nil. This could happen if the
user kills and removes a session at the same time.
---
dtache.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dtache.el b/dtache.el
index e627ab17d9..42f183271e 100644
--- a/dtache.el
+++ b/dtache.el
@@ -1116,9 +1116,9 @@ session and trigger a state transition."
(pcase-let* ((`(,_ ,action ,file) event))
(when (and (eq action 'deleted)
(string= "socket" (file-name-extension file)))
- (let* ((id (intern (file-name-base file)))
- (session (dtache--db-get-session id))
- (session-directory (dtache--session-directory session)))
+ (when-let* ((id (intern (file-name-base file)))
+ (session (dtache--db-get-session id))
+ (session-directory (dtache--session-directory session)))
;; Update session
(dtache--session-state-transition-update session)