Skip to content

Commit a4ec693

Browse files
authored
windows: Don't throw an error when the settings file is empty (#39908)
Closes #39585 Release Notes: - N/A
1 parent 08a2b68 commit a4ec693

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/migrator/src/migrator.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ fn run_migrations(text: &str, migrations: &[MigrationType]) -> Result<Option<Str
7878
let migrated_text = match migration {
7979
MigrationType::TreeSitter(patterns, query) => migrate(&current_text, patterns, query)?,
8080
MigrationType::Json(callback) => {
81+
if current_text.trim().is_empty() {
82+
return Ok(None);
83+
}
8184
let old_content: serde_json_lenient::Value =
8285
settings::parse_json_with_comments(&current_text)?;
8386
let old_value = serde_json::to_value(&old_content).unwrap();

0 commit comments

Comments
 (0)