Skip to content

Commit

Permalink
CoreTest: use has_value() check before accessing optional field (rdkc…
Browse files Browse the repository at this point in the history
  • Loading branch information
HaseenaSainul authored Jan 18, 2024
1 parent 6001c13 commit 78d9ddb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/sdks/core/src/cpp/sdk/cpptest/CoreSDKTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,13 @@ void PrintClosedCaptionsSettings( const Firebolt::Accessibility::ClosedCaptionsS
if (closedCaptionsSettings.styles.windowOpacity.has_value()) {
cout << "ClosedCaptionsSettings::Styles::WindowOpacity : " << closedCaptionsSettings.styles.windowOpacity.value() << endl;
}
cout << "ClosedCaptionsSettings::PreferredLanguages :";

for (auto index: closedCaptionsSettings.preferredLanguages.value()) {
cout << " " << index;
if (closedCaptionsSettings.preferredLanguages.has_value()) {
cout << "ClosedCaptionsSettings::PreferredLanguages :";
for (auto index: closedCaptionsSettings.preferredLanguages.value()) {
cout << " " << index;
}
cout << endl;
}
cout << endl;
}
void CoreSDKTest::GetAccessibilityClosedCaptionsSettings()
{
Expand Down

0 comments on commit 78d9ddb

Please sign in to comment.