windows: Don't throw an error when the settings file is empty (#39908)
Closes #39585 Release Notes: - N/A
This commit is contained in:
@@ -78,6 +78,9 @@ fn run_migrations(text: &str, migrations: &[MigrationType]) -> Result<Option<Str
|
||||
let migrated_text = match migration {
|
||||
MigrationType::TreeSitter(patterns, query) => migrate(¤t_text, patterns, query)?,
|
||||
MigrationType::Json(callback) => {
|
||||
if current_text.trim().is_empty() {
|
||||
return Ok(None);
|
||||
}
|
||||
let old_content: serde_json_lenient::Value =
|
||||
settings::parse_json_with_comments(¤t_text)?;
|
||||
let old_value = serde_json::to_value(&old_content).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user