diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-03 15:28:49 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-03 15:28:49 +0000 |
commit | 034430657c658e712de5ce8b827cf63ff45ca6e3 (patch) | |
tree | d4f9d1b108f733698374adddbd7930fce980b550 | |
parent | 7ecd6404ea465c547f3217016c1940f94682fb96 (diff) |
sx--site gracefully accepts nil argument
-rw-r--r-- | sx.el | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -269,11 +269,10 @@ with a `link' property). DATA can also be the link itself." (let ((link (if (stringp data) data (cdr (assoc 'link data))))) - (unless (stringp link) - (error "Data has no link property")) - (replace-regexp-in-string - "^https?://\\(?:\\(?1:[^/]+\\)\\.stackexchange\\|\\(?2:[^/]+\\)\\)\\.[^.]+/.*$" - "\\1\\2" link))) + (when (stringp link) + (replace-regexp-in-string + "^https?://\\(?:\\(?1:[^/]+\\)\\.stackexchange\\|\\(?2:[^/]+\\)\\)\\.[^.]+/.*$" + "\\1\\2" link)))) (defun sx--deep-dot-search (data) "Find symbols somewhere inside DATA which start with a `.'. |