aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-12-13 22:02:22 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-12-13 22:02:22 +0000
commit144db4c35bf902a045b221dae39d5437f7d9fb52 (patch)
tree043a45fe2297e3909c8fd3b8acd15d720b9099a8
parent0994dbcc9bebe2dae88e4f7c3a2478abed5718f5 (diff)
sx--ensure-site accepts nil. Fix #150
-rw-r--r--sx.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/sx.el b/sx.el
index 7dde8a7..fd39419 100644
--- a/sx.el
+++ b/sx.el
@@ -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.