Skip to content

Commit

Permalink
Just make the code check happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Dec 23, 2023
1 parent 9e3843b commit 50162d1
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,8 @@ protected override bool PositionMovable(TimeTagCaretPosition position)
protected override TimeTagCaretPosition? MoveToFirstLyric()
{
var firstLyric = Lyrics.FirstOrDefault(x => x.TimeTags.Any(timeTagMovable));
if (firstLyric == null)
return null;

var firstTimeTag = firstLyric.TimeTags.FirstOrDefault(timeTagMovable);
if (firstTimeTag == null)
var firstTimeTag = firstLyric?.TimeTags.FirstOrDefault(timeTagMovable);
if (firstLyric == null || firstTimeTag == null)
return null;

return CreateCaretPosition(firstLyric, firstTimeTag);
Expand All @@ -94,11 +91,8 @@ protected override bool PositionMovable(TimeTagCaretPosition position)
protected override TimeTagCaretPosition? MoveToLastLyric()
{
var lastLyric = Lyrics.LastOrDefault(x => x.TimeTags.Any(timeTagMovable));
if (lastLyric == null)
return null;

var lastTimeTag = lastLyric.TimeTags.LastOrDefault(timeTagMovable);
if (lastTimeTag == null)
var lastTimeTag = lastLyric?.TimeTags.LastOrDefault(timeTagMovable);
if (lastLyric == null || lastTimeTag == null)
return null;

return CreateCaretPosition(lastLyric, lastTimeTag);
Expand Down

0 comments on commit 50162d1

Please sign in to comment.