mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Fix devtool crashs after clicking Enable connection prompt
(#33305)
* Fix devtool crashs after clicking Enable connection prompt Signed-off-by: Taym <haddadi.taym@gmail.com> * Use early error return Signed-off-by: Taym <haddadi.taym@gmail.com> --------- Signed-off-by: Taym <haddadi.taym@gmail.com>
This commit is contained in:
parent
567c3185f8
commit
a43e296436
1 changed files with 5 additions and 1 deletions
|
@ -5,6 +5,7 @@
|
|||
use std::collections::HashMap;
|
||||
use std::net::TcpStream;
|
||||
|
||||
use log::warn;
|
||||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
use servo_config::pref_util::PrefValue;
|
||||
|
@ -37,7 +38,10 @@ impl Actor for PreferenceActor {
|
|||
stream: &mut TcpStream,
|
||||
_id: StreamId,
|
||||
) -> Result<ActorMessageStatus, ()> {
|
||||
let mut key = msg.get("value").unwrap().as_str().unwrap();
|
||||
let Some(mut key) = msg.get("value").and_then(|v| v.as_str()) else {
|
||||
warn!("PreferenceActor: handle_message: value is not a string");
|
||||
return Ok(ActorMessageStatus::Ignored);
|
||||
};
|
||||
|
||||
// Mapping to translate a Firefox preference name onto the corresponding Servo preference name
|
||||
let pref_name_mapping: HashMap<&str, &str> =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue