Fix seg fault in starter_cmd
When there is no status data on the /aos channel,
dereferencing the fetcher returns a nullptr for the starter Status.
Change-Id: Iad3606e5dc431d0f18722b13639c74d055956152
diff --git a/aos/starter/starter_rpc_lib.cc b/aos/starter/starter_rpc_lib.cc
index 67b3fb2..84b1a55 100644
--- a/aos/starter/starter_rpc_lib.cc
+++ b/aos/starter/starter_rpc_lib.cc
@@ -30,7 +30,7 @@
const aos::Configuration *config) {
std::string_view app_name = name;
for (const auto app : *config->applications()) {
- if (app->executable_name() != nullptr &&
+ if (app->has_executable_name() &&
app->executable_name()->string_view() == name) {
app_name = app->name()->string_view();
break;
@@ -74,7 +74,7 @@
event_loop.MakeFetcher<aos::starter::Status>("/aos");
initial_status_fetcher.Fetch();
auto initial_status =
- initial_status_fetcher
+ initial_status_fetcher.get()
? FindApplicationStatus(*initial_status_fetcher, name)
: nullptr;