We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06b9d26 commit 4d64bcfCopy full SHA for 4d64bcf
Assets/UXF/Scripts/Session.cs
@@ -486,15 +486,17 @@ Trial GetFirstTrial()
486
Trial GetLastTrial()
487
{
488
if (blocks.Count == 0) throw new NoSuchTrialException("There is no last trial because no blocks have been created!");
489
-
+
490
Block lastValidBlock;
491
+ Trial lastTrial;
492
int i = blocks.Count - 1;
493
while (i >= 0)
494
495
lastValidBlock = blocks[i];
- if (lastValidBlock.trials.Count > 0)
496
+ lastTrial = lastValidBlock.lastTrial;
497
+ if (lastTrial != null)
498
- return lastValidBlock.trials[lastValidBlock.trials.Count - 1];
499
+ return lastTrial;
500
}
501
i--;
502
0 commit comments