mirror of
https://github.com/redlib-org/redlib.git
synced 2025-05-15 06:22:50 +00:00
Handle Unwrapping Errors
This commit is contained in:
parent
5934e34ea0
commit
c046d00060
5 changed files with 32 additions and 24 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue