File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -620,7 +620,14 @@ Trial GetPrevTrial()
620
620
Trial GetFirstTrial ( )
621
621
{
622
622
var firstBlock = blocks [ 0 ] ;
623
- return firstBlock . trials [ 0 ] ;
623
+ try
624
+ {
625
+ return firstBlock . trials [ 0 ] ;
626
+ }
627
+ catch ( ArgumentOutOfRangeException )
628
+ {
629
+ throw new NoSuchTrialException ( "There is no first trial. No trials exist in the first block." ) ;
630
+ }
624
631
}
625
632
626
633
/// <summary>
@@ -630,7 +637,14 @@ Trial GetFirstTrial()
630
637
Trial GetLastTrial ( )
631
638
{
632
639
var lastBlock = blocks [ blocks . Count - 1 ] ;
633
- return lastBlock . trials [ lastBlock . trials . Count - 1 ] ;
640
+ try
641
+ {
642
+ return lastBlock . trials [ lastBlock . trials . Count - 1 ] ;
643
+ }
644
+ catch ( ArgumentOutOfRangeException )
645
+ {
646
+ throw new NoSuchTrialException ( "There is no last trial. No trials exist in the last block." ) ;
647
+ }
634
648
}
635
649
636
650
/// <summary>
You can’t perform that action at this time.
0 commit comments