Skip to content

Commit

Permalink
Don't traceback if markdown text is None
Browse files Browse the repository at this point in the history
Originally reported on StackOverflow:
https://stackoverflow.com/questions/53662887/
  • Loading branch information
atodorov committed Dec 11, 2018
1 parent a03bbb9 commit 97ccf47
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tcms/core/templatetags/extra_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def markdown2html(md_str):
"""
Returns markdown string as HTML.
"""
if md_str is None:
md_str = ''

rendered_md = markdown.markdown(md_str,
extensions=['markdown.extensions.fenced_code',
'markdown.extensions.nl2br'])
Expand Down

0 comments on commit 97ccf47

Please sign in to comment.