From 6cfc103bd3112e0a91e1c9154261f62cdee4525f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 22 Jan 2014 21:41:26 -0500 Subject: [PATCH] fix user media permission --- .../AuthorizationRequestFilterAttribute.cs | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/MediaBrowser.Api/AuthorizationRequestFilterAttribute.cs b/MediaBrowser.Api/AuthorizationRequestFilterAttribute.cs index 6cecbd0b62..6c56083cbf 100644 --- a/MediaBrowser.Api/AuthorizationRequestFilterAttribute.cs +++ b/MediaBrowser.Api/AuthorizationRequestFilterAttribute.cs @@ -98,17 +98,20 @@ namespace MediaBrowser.Api { var auth = GetAuthorizationDictionary(httpReq); - string userId; - string deviceId; - string device; - string client; - string version; + string userId = null; + string deviceId = null; + string device = null; + string client = null; + string version = null; - auth.TryGetValue("UserId", out userId); - auth.TryGetValue("DeviceId", out deviceId); - auth.TryGetValue("Device", out device); - auth.TryGetValue("Client", out client); - auth.TryGetValue("Version", out version); + if (auth != null) + { + auth.TryGetValue("UserId", out userId); + auth.TryGetValue("DeviceId", out deviceId); + auth.TryGetValue("Device", out device); + auth.TryGetValue("Client", out client); + auth.TryGetValue("Version", out version); + } return new AuthorizationInfo {