diff --git a/orchagent/saihelper.cpp b/orchagent/saihelper.cpp index e096fb86f9..6deae90b04 100644 --- a/orchagent/saihelper.cpp +++ b/orchagent/saihelper.cpp @@ -1110,6 +1110,12 @@ std::vector queryAvailableCounterStats(const sai_object_type_t ob std::vector stat_list; auto info = sai_metadata_get_object_type_info(object_type); + if (!info) + { + SWSS_LOG_ERROR("Metadata info query failed, invalid object: %d", object_type); + return stat_list; + } + SWSS_LOG_NOTICE("SAI object %s supports stat type %s", sai_serialize_object_type(object_type).c_str(), info->statenum->name);