mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-04 05:12:51 +01:00
check parsed floats for NaN in media info providers
This commit is contained in:
@@ -262,11 +262,15 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
|
||||
{
|
||||
var parts = value.Split('/');
|
||||
|
||||
float result;
|
||||
|
||||
if (parts.Length == 2)
|
||||
{
|
||||
return float.Parse(parts[0]) / float.Parse(parts[1]);
|
||||
result = float.Parse(parts[0]) / float.Parse(parts[1]);
|
||||
}
|
||||
return float.Parse(parts[0]);
|
||||
result = float.Parse(parts[0]);
|
||||
|
||||
return float.IsNaN(result) ? (float?)null : result;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user