Skip to content

Commit

Permalink
Adding negative trial checks
Browse files Browse the repository at this point in the history
  • Loading branch information
keenon committed Sep 24, 2024
1 parent a75d0d1 commit bd66cec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dart/biomechanics/SubjectOnDisk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ std::string SubjectOnDisk::getOpensimFileText(int passNumberToLoad)
// frequency of that filter?
s_t SubjectOnDisk::getLowpassCutoffFrequency(int trial, int processingPass)
{
if (trial >= getNumTrials())
if (trial >= getNumTrials() || trial < 0)
{
std::cout << "SubjectOnDisk::getLowpassCutoffFrequency() called with "
"invalid trial number: "
Expand All @@ -765,7 +765,7 @@ s_t SubjectOnDisk::getLowpassCutoffFrequency(int trial, int processingPass)
// that (Butterworth) filter?
int SubjectOnDisk::getLowpassFilterOrder(int trial, int processingPass)
{
if (trial >= getNumTrials())
if (trial >= getNumTrials() || trial < 0)
{
std::cout << "SubjectOnDisk::getLowpassFilterOrder() called with invalid "
"trial number: "
Expand All @@ -789,7 +789,7 @@ int SubjectOnDisk::getLowpassFilterOrder(int trial, int processingPass)
std::vector<s_t> SubjectOnDisk::getForceplateCutoffs(
int trial, int processingPass)
{
if (trial >= getNumTrials())
if (trial >= getNumTrials() || trial < 0)
{
std::cout << "SubjectOnDisk::getForceplateCutoffs() called with invalid "
"trial number: "
Expand Down

0 comments on commit bd66cec

Please sign in to comment.