From cb3d8727fbf65ea16a3bf25c6d4c7251b2f3d7d2 Mon Sep 17 00:00:00 2001 From: Marek Kaput Date: Wed, 11 Dec 2024 15:28:02 +0100 Subject: [PATCH] Do not panic if one of the dependencies tables is missing (#3) --- src/upgrade.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/upgrade.rs b/src/upgrade.rs index f06c61b..8ddeb8c 100644 --- a/src/upgrade.rs +++ b/src/upgrade.rs @@ -81,6 +81,9 @@ fn edit_dependencies(cargo_toml: &mut DocumentMut, table_path: &str, args: &Args else { return; }; + if deps.is_none() { + return; + } let deps = deps.as_table_mut().unwrap(); for (_, dep) in deps.iter_mut().filter(|(key, _)| args.dep.owns(key)) {