- if (nr_ids == 1 && lttng_tracker_id_get_type(ids[0]) == LTTNG_ID_ALL) {
- /* Tracking all, nothing to output. */
- ret = LTTNG_OK;
- goto end;
+ nr_ids = lttng_tracker_ids_get_count(ids);
+
+ if (nr_ids == 1) {
+ id = lttng_tracker_ids_get_at_index(ids, 0);
+ if (id && lttng_tracker_id_get_type(id) == LTTNG_ID_ALL) {
+ /* Tracking all, nothing to output. */
+ ret = LTTNG_OK;
+ goto end;
+ }