Browse Source

Only regexp-replace newlines in description if it is non-nil

Adam Awan 6 years ago
parent
commit
00fcdc750f
1 changed files with 5 additions and 3 deletions
  1. 5 3
      os-github.el

+ 5 - 3
os-github.el

@@ -220,9 +220,11 @@ Return the server decoded JSON response."
 ;; XXX: we need an actual markdown parser here...
 (defun os-github-filter-desc (desc)
   "Return a filtered description of a GitHub description."
-  (setq desc (replace-regexp-in-string "\r\n" "\n" desc))
-  (setq desc (replace-regexp-in-string "\\([^ \t\n]\\)[ \t\n]*\\'"
-                                       "\\1\n" desc)))          
+  (if desc (progn
+             (setq desc (replace-regexp-in-string "\r\n" "\n" desc))
+             (setq desc (replace-regexp-in-string "\\([^ \t\n]\\)[ \t\n]*\\'"
+                                                  "\\1\n" desc)))))
+
 
 (defun os-github-json-to-bug (data)
   "Return DATA (in json) converted to a bug."