Skip to content

Commit 12ac865

Browse files
authored
fix(list): fix oma list get upgradable item will panic (#337)
1 parent 527ad94 commit 12ac865

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/subcommand/list.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,9 @@ impl CliExecuter for List {
215215
"{}/{} {} {arch} {s}",
216216
color_formatter().color_str(&name, Action::Emphasis).bold(),
217217
color_formatter().color_str(branches_str, Action::Secondary),
218-
if upgradable {
219-
version_str = Cow::Owned(format!(
220-
"{} -> {}",
221-
version_str,
222-
new_version.as_ref().unwrap(),
223-
));
218+
if let Some(new_version) = new_version {
219+
version_str =
220+
Cow::Owned(format!("{} -> {}", version_str, new_version));
224221
color_formatter().color_str(version_str, Action::WARN)
225222
} else {
226223
color_formatter().color_str(version_str, Action::EmphasisSecondary)

0 commit comments

Comments
 (0)