@@ -462,9 +462,9 @@ public void LoadBranch(int index)
462
462
}
463
463
464
464
/// <remarks>assumes a TAStudio project is loaded</remarks>
465
- private TasMovieMarkerList MarkerListForBranch ( int ? branchIndex )
465
+ private TasMovieMarkerList /*?*/ MarkerListForBranch ( int ? branchIndex )
466
466
=> branchIndex is int i
467
- ? Tastudio . CurrentTasMovie . Branches [ i ] . Markers
467
+ ? Tastudio . CurrentTasMovie . Branches . ElementAtOrDefault ( i ) ? . Markers
468
468
: Tastudio . CurrentTasMovie . Markers ;
469
469
470
470
[ LuaMethodExample ( """
@@ -476,8 +476,8 @@ private TasMovieMarkerList MarkerListForBranch(int? branchIndex)
476
476
+ " This may be the power-on marker at 0. Returns nil if the arguments are invalid or TAStudio isn't active."
477
477
+ " If branchIndex is specified, searches the markers in that branch instead." ) ]
478
478
public int ? FindMarkerOnOrBefore ( int frame , int ? branchIndex = null )
479
- => Engaged ( )
480
- ? MarkerListForBranch ( branchIndex ) . PreviousOrCurrent ( frame ) ? . Frame
479
+ => Engaged ( ) && MarkerListForBranch ( branchIndex ) is TasMovieMarkerList markers
480
+ ? markers . PreviousOrCurrent ( frame ) ? . Frame
481
481
: null ;
482
482
483
483
[ LuaMethodExample ( """
@@ -488,8 +488,8 @@ private TasMovieMarkerList MarkerListForBranch(int? branchIndex)
488
488
description : "Returns a list of all the frames which have markers on them."
489
489
+ " If branchIndex is specified, instead returns the frames which have markers in that branch." ) ]
490
490
public LuaTable GetFramesWithMarkers ( int ? branchIndex = null )
491
- => Engaged ( )
492
- ? _th . EnumerateToLuaTable ( MarkerListForBranch ( branchIndex ) . Select ( static m => m . Frame ) )
491
+ => Engaged ( ) && MarkerListForBranch ( branchIndex ) is TasMovieMarkerList markers
492
+ ? _th . EnumerateToLuaTable ( markers . Select ( static m => m . Frame ) )
493
493
: _th . CreateTable ( ) ;
494
494
495
495
[ LuaMethodExample ( "tastudio.removemarker( 500 );" ) ]
0 commit comments