Skip to content

Commit

Permalink
fix string-match fail on nil input
Browse files Browse the repository at this point in the history
  • Loading branch information
zweifisch committed Jul 9, 2016
1 parent 358dded commit 47a7b36
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ob-http.el
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@
`(,(s-downcase (car key-value)) . ,(cadr key-value))))

(defun ob-http-parse-content-type (content-type)
(cond
((string-match "json" content-type) 'json)
((string-match "html" content-type) 'html)
((string-match "xml" content-type) 'xml)))
(when content-type
(cond
((string-match "json" content-type) 'json)
((string-match "html" content-type) 'html)
((string-match "xml" content-type) 'xml))))

(defun ob-http-shell-command-to-string (command input)
(with-temp-buffer
Expand Down

0 comments on commit 47a7b36

Please sign in to comment.