add null checks on session & device creation

This commit is contained in:
Luke Pulverenti
2016-05-30 12:22:31 -04:00
parent f8a0cf4637
commit ca100ff2d1
2 changed files with 9 additions and 0 deletions

View File

@@ -51,6 +51,11 @@ namespace MediaBrowser.Server.Implementations.Devices
public async Task<DeviceInfo> RegisterDevice(string reportedId, string name, string appName, string appVersion, string usedByUserId)
{
if (string.IsNullOrWhiteSpace(reportedId))
{
throw new ArgumentNullException("reportedId");
}
var device = GetDevice(reportedId) ?? new DeviceInfo
{
Id = reportedId