Crash with nice errors if the config is completely missing channels
I did this by mistake and got a segfault instead of the nice errors
everything is set up to generate.
Change-Id: I645bebffcaeea65058685813278a7f9ea537484a
diff --git a/aos/configuration.cc b/aos/configuration.cc
index ad2e295..bf06879 100644
--- a/aos/configuration.cc
+++ b/aos/configuration.cc
@@ -593,6 +593,10 @@
std::string_view type,
std::string_view application_name, const Node *node,
bool quiet) {
+ if (!config->has_channels()) {
+ return nullptr;
+ }
+
const std::string_view original_name = name;
std::string mutable_name;
if (node != nullptr) {