Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix https://github.com/rustdesk/rustdesk-server-pro/issues/334 again

rustdeskd9fba50606ef
diff --git a/src/client.rs b/src/client.rs
index d6d8f8546..4156de133 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -2111,11 +2111,15 @@ impl LoginConfigHandler {
};
let mut display_name = get_buildin_option(config::keys::OPTION_DISPLAY_NAME);
if display_name.is_empty() {
- display_name = serde_json::from_str::<HashMap<String, String>>(
- &LocalConfig::get_option("user_info"),
- )
- .map(|mut x| x.remove("name").unwrap_or_default())
- .unwrap_or_default();
+ display_name =
+ serde_json::from_str::<serde_json::Value>(&LocalConfig::get_option("user_info"))
+ .map(|x| {
+ x.get("name")
+ .map(|x| x.as_str().unwrap_or_default())
+ .unwrap_or_default()
+ .to_owned()
+ })
+ .unwrap_or_default();
}
if display_name.is_empty() {
display_name = crate::username();