Fix regressions in #6477 (#6826)

* Fix if statement in ClipView

* Move controllers.begin() to be the first argument
It was the second argument, which means it could've
returned negatives for random access iterators.
This commit is contained in:
saker
2023-08-23 16:52:35 -04:00
committed by GitHub
parent 9a0add49fb
commit da14de92fe
2 changed files with 2 additions and 2 deletions

View File

@@ -559,7 +559,7 @@ DataFile ClipView::createClipDataFiles(
// Add extra metadata needed for calculations later
const auto initialTrackIt = std::find(tc->tracks().begin(), tc->tracks().end(), t);
if (initialTrackIt != tc->tracks().end())
if (initialTrackIt == tc->tracks().end())
{
printf("Failed to find selected track in the TrackContainer.\n");
return dataFile;

View File

@@ -263,7 +263,7 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent,
if (it != controllers.end())
{
int idx = std::distance(it, controllers.begin());
int idx = std::distance(controllers.begin(), it);
m_userGroupBox->model()->setValue( true );
m_userController->model()->setValue( idx );
}