aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-01-25 14:13:04 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-01-25 14:13:04 -0500
commit8b78b69f57364bd1227d0db84663d1ffef077d36 (patch)
treefefa008a0a215597b324f8a590bde3dd2af12dc4 /MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs
parenta1a56557ece84d8b726a6c06b2620fa43ff22461 (diff)
updated translations
Diffstat (limited to 'MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs b/MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs
index 70a04d249..6d324b1ab 100644
--- a/MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs
+++ b/MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs
@@ -60,6 +60,12 @@ namespace MediaBrowser.Server.Implementations.Devices
public Task SaveCapabilities(string reportedId, ClientCapabilities capabilities)
{
var device = GetDevice(reportedId);
+
+ if (device == null)
+ {
+ throw new ArgumentException("No device has been registed with id " + reportedId);
+ }
+
device.Capabilities = capabilities;
SaveDevice(device);
@@ -75,6 +81,11 @@ namespace MediaBrowser.Server.Implementations.Devices
public DeviceInfo GetDevice(string id)
{
+ if (string.IsNullOrWhiteSpace(id))
+ {
+ throw new ArgumentNullException("id");
+ }
+
return GetDevices()
.FirstOrDefault(i => string.Equals(i.Id, id, StringComparison.OrdinalIgnoreCase));
}