X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=src%2Fcpp-common%2Fbt2%2Ffield.hpp;h=bf470e0bbbd2dc33775eee839c7ced6c891bed9a;hb=b5cc976beb06b03b46950d3b3505d763021bdf7a;hp=6853510eb0cf55ddfc4536d93a0500540a01b1e6;hpb=d2ba27dd1502473c84d22acfa14e5a5c33fd194b;p=babeltrace.git diff --git a/src/cpp-common/bt2/field.hpp b/src/cpp-common/bt2/field.hpp index 6853510e..bf470e0b 100644 --- a/src/cpp-common/bt2/field.hpp +++ b/src/cpp-common/bt2/field.hpp @@ -1497,7 +1497,9 @@ public: static_assert(!std::is_const::value, "Not available with `bt2::ConstVariantField`."); - static_cast(bt_field_variant_select_option_by_index(this->libObjPtr(), index)); + const auto status = bt_field_variant_select_option_by_index(this->libObjPtr(), index); + + BT_ASSERT_DBG(status == BT_FIELD_VARIANT_SELECT_OPTION_STATUS_OK); } CommonField selectedOptionField() const noexcept