Skip to content

Commit ef73380

Browse files
niksedkclaude
andcommitted
Fix latent NRE in Reopen seek and remove dead local
The deferred seek lambda in the Reopen flow re-read the SelectedSubtitle property instead of the null-checked local snapshot. Since the post runs on a later UI tick, closing the file or clearing the selection in that window would make SelectedSubtitle null and throw an NRE on the UI thread. Use the captured local `s`, which is already null-checked. Also drop the now-unused colorTextTooLong local in SubtitleTextInfoHelper.Populate (CPS coloring switched to ColorCharactersPerSecond). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e1da4b5 commit ef73380

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/ui/Features/Main/MainViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ private void CommandFileReopen(RecentFile recentFile)
18341834
if (vp != null && s != null)
18351835
{
18361836
vp.Position = s.StartTime.TotalSeconds;
1837-
Dispatcher.UIThread.Post(() => { vp.Position = SelectedSubtitle.StartTime.TotalSeconds; });
1837+
Dispatcher.UIThread.Post(() => { vp.Position = s.StartTime.TotalSeconds; });
18381838
CenterAudioVisualizerOnCurrentVideoPosition();
18391839
}
18401840
}

src/ui/Logic/SubtitleTextInfoHelper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ internal static void Populate(
3838
out IBrush totalBackground)
3939
{
4040
var info = PopulateLineLengthsAndTotal(text, panel);
41-
var colorTextTooLong = Se.Settings.General.ColorTextTooLong;
4241
var maxCps = Se.Settings.General.SubtitleMaximumCharactersPerSeconds;
4342

4443
var cps = GetCharactersPerSecond(text, item.StartTime, item.EndTime);

0 commit comments

Comments
 (0)