add device null check

This commit is contained in:
Luke Pulverenti 2015-03-29 11:04:33 -04:00
parent 578dec0c71
commit 87bf3bbb8f
1 changed files with 5 additions and 2 deletions

View File

@ -432,9 +432,12 @@ namespace MediaBrowser.Server.Implementations.Session
device = device ?? _deviceManager.GetDevice(deviceId);
if (!string.IsNullOrEmpty(device.CustomName))
if (device != null)
{
deviceName = device.CustomName;
if (!string.IsNullOrEmpty(device.CustomName))
{
deviceName = device.CustomName;
}
}
sessionInfo.DeviceName = deviceName;