Handle Unwrapping Errors

This commit is contained in:
spikecodes 2021-01-03 21:31:21 -08:00
parent 5934e34ea0
commit c046d00060
5 changed files with 32 additions and 24 deletions

View file

@ -58,7 +58,7 @@ pub async fn wiki(req: HttpRequest) -> HttpResponse {
Ok(res) => {
let s = WikiTemplate {
sub: sub.to_string(),
wiki: rewrite_url(res["data"]["content_html"].as_str().unwrap()),
wiki: rewrite_url(res["data"]["content_html"].as_str().unwrap_or_default()),
page: page.to_string(),
}
.render()