Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
feat: fix crashing when invalid command/url
Browse files Browse the repository at this point in the history
  • Loading branch information
PThorpe92 committed Nov 6, 2023
1 parent 294c598 commit 96d4124
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/request/curl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,7 @@ impl<'a> CmdOpts for Curl<'a> {
} else {
Err(String::from("Error making connection"))
}
} else {
self.curl.perform().unwrap();
} else if self.curl.perform().is_ok() {
let contents = self.curl.get_ref();
let res = String::from_utf8_lossy(&contents.0);
if let Ok(json) =
Expand All @@ -396,6 +395,8 @@ impl<'a> CmdOpts for Curl<'a> {
self.resp = Some(res.to_string());
Ok(())
}
} else {
return Err(String::from("Error executing command"));
}
}
}
Expand Down

0 comments on commit 96d4124

Please sign in to comment.