Move node() == nullptr check into //aos:configuration
This simplifies the code surprisingly significantly for dealing with
single node systems.
Change-Id: Ib317e16a9055fbf1341a194120a5b34f05b2d8f8
diff --git a/aos/configuration.cc b/aos/configuration.cc
index 112c567..4a98297 100644
--- a/aos/configuration.cc
+++ b/aos/configuration.cc
@@ -643,10 +643,17 @@
}
bool ChannelIsSendableOnNode(const Channel *channel, const Node *node) {
+ if (node == nullptr) {
+ return true;
+ }
return (channel->source_node()->string_view() == node->name()->string_view());
}
bool ChannelIsReadableOnNode(const Channel *channel, const Node *node) {
+ if (node == nullptr) {
+ return true;
+ }
+
if (channel->source_node()->string_view() == node->name()->string_view()) {
return true;
}