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

@ -21,7 +21,7 @@ pub async fn handler(web::Path(b64): web::Path<String>) -> Result<HttpResponse>
match decode(b64) {
Ok(bytes) => {
let media = String::from_utf8(bytes).unwrap();
let media = String::from_utf8(bytes).unwrap_or_default();
match Url::parse(media.as_str()) {
Ok(url) => {