diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-13 22:02:22 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-13 22:02:22 +0000 |
commit | 144db4c35bf902a045b221dae39d5437f7d9fb52 (patch) | |
tree | 043a45fe2297e3909c8fd3b8acd15d720b9099a8 | |
parent | 0994dbcc9bebe2dae88e4f7c3a2478abed5718f5 (diff) |
sx--ensure-site accepts nil. Fix #150
-rw-r--r-- | sx.el | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -297,10 +297,11 @@ DATA can also be the link itself." "Add a `site' property to DATA if it doesn't have one. Return DATA. DATA can be a question, answer, comment, or user (or any object with a `link' property)." - (unless (assq 'site data) - (setcdr data (cons (cons 'site (sx--site data)) - (cdr data)))) - data) + (when data + (unless (assq 'site data) + (setcdr data (cons (cons 'site (sx--site data)) + (cdr data)))) + data)) (defmacro sx-assoc-let (alist &rest body) "Identical to `let-alist', except `.site' has a special meaning. |