listener fix incorrect "never published" cases (#13006)

- fixes #12955
This commit is contained in:
Daniel Agar
2019-09-25 10:46:13 +02:00
committed by Julian Oes
parent bc8781d130
commit b6db872303
@@ -82,7 +82,16 @@ void listener(listener_print_topic_cb cb, const orb_id_t &id, unsigned num_msgs,
}
}
if (instances == 0) {
PX4_INFO_RAW("never published\n");
}
} else {
// default to the first instance if not specified
if (topic_instance == -1) {
topic_instance = 0;
}
if (orb_exists(id, topic_instance) != 0) {
PX4_INFO_RAW("never published\n");
return;