windows: Don't throw an error when the settings file is empty (#39908)

Closes #39585 

Release Notes:

- N/A
This commit is contained in:
Cole Miller
2025-10-09 23:00:16 +00:00
committed by GitHub
parent 08a2b6898b
commit a4ec693e34
+3
View File
@@ -78,6 +78,9 @@ fn run_migrations(text: &str, migrations: &[MigrationType]) -> Result<Option<Str
let migrated_text = match migration {
MigrationType::TreeSitter(patterns, query) => migrate(&current_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(&current_text)?;
let old_value = serde_json::to_value(&old_content).unwrap();