Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

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

Cole Millera4ec693e3471
diff --git a/crates/migrator/src/migrator.rs b/crates/migrator/src/migrator.rs
index a493b1efbe0..dbf7605e1db 100644
--- a/crates/migrator/src/migrator.rs
+++ b/crates/migrator/src/migrator.rs
@@ -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();