settings: list of visualizer colors cannot be empty

This commit is contained in:
Andrzej Rybczak
2014-10-26 23:54:51 +01:00
parent e970a9d4ae
commit 6da5c2a1d0

View File

@@ -247,6 +247,8 @@ bool Configuration::read(const std::string &config_path)
auto color = stringToColor(*i);
visualizer_colors.push_back(color);
}
if (visualizer_colors.empty())
throw std::runtime_error("empty list");
}, [this] {
visualizer_colors = { NC::Color::Blue, NC::Color::Cyan, NC::Color::Green, NC::Color::Yellow, NC::Color::Magenta, NC::Color::Red };
}));