Fix exception on opening Play Movie dialog with multiple movies
fixes 9211007a1
This commit is contained in:
parent
bd58bde07c
commit
8453c0e44d
|
@ -195,18 +195,25 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prefer tas files
|
// Prefer tas files
|
||||||
|
// but `_movieList` should only contain `.bk2` and `.tasproj` so... isn't that all of them? or, it is now I've fixed the case-sensitivity bug --yoshi
|
||||||
var tas = new List<int>();
|
var tas = new List<int>();
|
||||||
for (var i = 0; i < indices.Count; i++)
|
for (var i = 0; i < indices.Count; i++)
|
||||||
{
|
{
|
||||||
foreach (var ext in MovieService.MovieExtensions)
|
foreach (var ext in MovieService.MovieExtensions)
|
||||||
{
|
{
|
||||||
if (Path.GetExtension(_movieList[indices[i]].Filename)?.ToUpper() == $".{ext}")
|
if ($".{ext}".Equals(Path.GetExtension(_movieList[indices[i]].Filename), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
tas.Add(i);
|
tas.Add(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tas.Count is 0)
|
||||||
|
{
|
||||||
|
if (_movieList.Count is not 0) HighlightMovie(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (tas.Count == 1)
|
if (tas.Count == 1)
|
||||||
{
|
{
|
||||||
HighlightMovie(tas[0]);
|
HighlightMovie(tas[0]);
|
||||||
|
|
Loading…
Reference in New Issue