@@ -196,7 +196,10 @@ fn run(matches: &ArgMatches) -> Result<()> {
196196 let theme_dir = home_dir.join(".config").join("bat").join("themes");
197197 let theme_set = ThemeSet::load_from_folder(theme_dir)
198198 .map_err(|_| io::Error::new(ErrorKind::Other, "Could not load themes"))?;
199− let theme = &theme_set.themes["Default"];
199+ let theme = &theme_set.themes.get("Default").ok_or(io::Error::new(
200+ ErrorKind::Other,
201+ "Could not load default theme (~/.config/bat/themes/Default.tmTheme)",
202+ ))?;
200203
201204 // TODO: let mut syntax_set = SyntaxSet::load_defaults_nonewlines();
202205 let mut syntax_set = SyntaxSet::new();