From 716fa79500eaed7031bf1db65a4e2e90634652f8 Mon Sep 17 00:00:00 2001 From: Thorou Date: Mon, 8 Jul 2024 09:42:59 +0200 Subject: [PATCH] Fix panic when blame-palette is empty (#1737) * Fix panic when blame-palette is empty * Move check to config.rs --- src/config.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/config.rs b/src/config.rs index 5247cdf85..351d57d4c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -214,6 +214,10 @@ impl From for Config { let blame_palette = make_blame_palette(opt.blame_palette, opt.computed.is_light_mode); + if blame_palette.is_empty() { + fatal("Option 'blame-palette' must not be empty.") + } + let file_added_label = opt.file_added_label; let file_copied_label = opt.file_copied_label; let file_modified_label = opt.file_modified_label;