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()
620620 Trial GetFirstTrial ( )
621621 {
622622 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+ }
624631 }
625632
626633 /// <summary>
@@ -630,7 +637,14 @@ Trial GetFirstTrial()
630637 Trial GetLastTrial ( )
631638 {
632639 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+ }
634648 }
635649
636650 /// <summary>
You can’t perform that action at this time.
0 commit comments