diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-09-06 16:50:12 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-09-06 16:50:12 -0500 |
| commit | 1eae76fc157b0d19603a5c9f57b813b6c15eb997 (patch) | |
| tree | c668893f92e311b9815717ca3b356982cbd6852d /src | |
| parent | cf63c825d4e0b34d9b07c12d468ff9be2596d740 (diff) | |
| download | invidious-1eae76fc157b0d19603a5c9f57b813b6c15eb997.tar.gz invidious-1eae76fc157b0d19603a5c9f57b813b6c15eb997.tar.bz2 invidious-1eae76fc157b0d19603a5c9f57b813b6c15eb997.zip | |
Add fix for empty descriptions
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/helpers/helpers.cr | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index 2af65e74..fccffd18 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -184,7 +184,12 @@ def html_to_content(description_html) description_html = description_html.to_s description = description_html.gsub("<br>", "\n") description = description.gsub("<br/>", "\n") - description = XML.parse_html(description).content.strip("\n ") + + if description.empty? + description = "" + else + description = XML.parse_html(description).content.strip("\n ") + end end return description_html, description |
