diff options
Diffstat (limited to 'cli/lockfile.rs')
-rw-r--r-- | cli/lockfile.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/lockfile.rs b/cli/lockfile.rs index ea1429829..33f5768fb 100644 --- a/cli/lockfile.rs +++ b/cli/lockfile.rs @@ -45,7 +45,10 @@ impl Lockfile { let j = json!(&self.map); let s = serde_json::to_string_pretty(&j).unwrap(); - let format_s = format_json(&s, &Default::default()).unwrap_or(s); + let format_s = format_json(&s, &Default::default()) + .ok() + .flatten() + .unwrap_or(s); let mut f = std::fs::OpenOptions::new() .write(true) .create(true) |