Merge pull request #4861 from crobibero/null-ref

Fix null reference when logging
This commit is contained in:
Joshua M. Boniface 2020-12-24 12:19:02 -05:00 committed by GitHub
commit 93b754c366
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1033,9 +1033,9 @@ namespace MediaBrowser.Model.Dlna
{
_logger.LogInformation(
"Profile: {0}, No video direct play profiles found for {1} with codec {2}",
profile.Name ?? "Unknown Profile",
mediaSource.Path ?? "Unknown path",
videoStream.Codec ?? "Unknown codec");
profile?.Name ?? "Unknown Profile",
mediaSource?.Path ?? "Unknown path",
videoStream?.Codec ?? "Unknown codec");
return (null, GetTranscodeReasonsFromDirectPlayProfile(mediaSource, videoStream, audioStream, profile.DirectPlayProfiles));
}