Skip to content

Commit

Permalink
ui/video-presets: Fix referencing nullptr when no video preset loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
leikareipa committed Nov 11, 2023
1 parent c35f09b commit 53d3be2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const struct semantic_version_s
{
unsigned major = 3;
unsigned minor = 4;
unsigned patch = 0;
unsigned patch = 1;
} VCS_VERSION;

// The minimum and maximum resolution we can output frames in.
Expand Down
8 changes: 7 additions & 1 deletion src/display/qt/windows/ControlPanel/VideoPresets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,15 @@ control_panel::VideoPresets::VideoPresets(QWidget *parent) :
ui->parameterGrid_properties->clear();
for (const char* propName: kc_supported_video_preset_properties())
{
const int currentValue = (
(ui->comboBox_presetList->current_preset() && ui->comboBox_presetList->current_preset()->properties.contains(propName))
? ui->comboBox_presetList->current_preset()->properties[propName]
: kc_device_property(std::string(propName) + ": default")
);

ui->parameterGrid_properties->add_scroller(
propName,
ui->comboBox_presetList->current_preset()->properties[propName],
currentValue,
kc_device_property(std::string(propName) + ": minimum"),
kc_device_property(std::string(propName) + ": maximum")
);
Expand Down

0 comments on commit 53d3be2

Please sign in to comment.