diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2022-09-08 16:08:13 +0200 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2022-09-08 16:08:13 +0200 |
| commit | 5fa2c1d460a21216eb7773fb28ff36f89b305e36 (patch) | |
| tree | cbabee82daca96f8538db8c388f1fb1981474a7a | |
| parent | cb993b1ac8901da35acfab16de13ad7a0982bce2 (diff) | |
fetch-entry-holdings-by-id: only release semaphor when response is not nil
| -rw-r--r-- | local/bibli-paris/bibli-paris.el | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/local/bibli-paris/bibli-paris.el b/local/bibli-paris/bibli-paris.el index eeccff9..9665ead 100644 --- a/local/bibli-paris/bibli-paris.el +++ b/local/bibli-paris/bibli-paris.el @@ -156,15 +156,16 @@ more on MATCH and SCOPE." (deferred:nextc it (lambda (response) (progn - (cc:semaphore-release bibli-paris/async-requests-smp) - (let ((error-thrown (request-response-error-thrown response))) - (if error-thrown - (let ((error-symbol (car error-thrown)) - (error-data (cdr error-thrown))) - (signal error-symbol error-data)) - (let* ((data (request-response-data response)) - (d (gethash "d" data))) - (if d (gethash "Holdings" d) nil))))))))) + (when response + (cc:semaphore-release bibli-paris/async-requests-smp) + (let ((error-thrown (request-response-error-thrown response))) + (if error-thrown + (let ((error-symbol (car error-thrown)) + (error-data (cdr error-thrown))) + (signal error-symbol error-data)) + (let* ((data (request-response-data response)) + (d (gethash "d" data))) + (if d (gethash "Holdings" d) nil))))))))) (defun bibli-paris/find-library-holding (holdings &optional library) |
