mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Android: Fix JSON error when no arguments are passed
This commit is contained in:
parent
3e09d7270a
commit
fb8d8b33ac
1 changed files with 8 additions and 6 deletions
|
@ -95,12 +95,14 @@ pub fn init(
|
|||
) -> Result<(), &'static str> {
|
||||
resources::set(Box::new(ResourceReader(readfile)));
|
||||
|
||||
if !argsline.is_empty() {
|
||||
let mut args: Vec<String> = serde_json::from_str(&argsline).map_err(|_| {
|
||||
"Invalid arguments. Servo arguments must be formatted as a JSON array"
|
||||
})?;
|
||||
// opts::from_cmdline_args expects the first argument to be the binary name.
|
||||
args.insert(0, "servo".to_string());
|
||||
opts::from_cmdline_args(&args);
|
||||
}
|
||||
|
||||
let embedder_url = embedder_url.as_ref().and_then(|s| {
|
||||
ServoUrl::parse(s).ok()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue