branch: externals/ebdb
commit 7570ed951a639ebc39ba53e84f7e17ea2b9a8620
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
Protect against non-present records in role delete method
* ebdb.el (ebdb-delete): This whole thing with the roles needs to be
reworked.
---
ebdb.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index 0656bc2..ef9ed85 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -963,10 +963,11 @@ process."
(cl-defmethod ebdb-delete ((role ebdb-field-role) &optional record unload)
(when record
(let* ((org-uuid (slot-value role 'org-uuid))
+ (org (ebdb-gethash org-uuid 'uuid))
(org-string
- (slot-value
- (ebdb-gethash org-uuid 'uuid)
- 'name))
+ (if org
+ (slot-value org 'name)
+ "bogus"))
(org-entry (gethash org-uuid ebdb-org-hashtable))
(record-uuid (ebdb-record-uuid record))
record-entry new-org-entry)