diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-22 21:41:26 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-22 21:41:26 -0500 |
| commit | 6cfc103bd3112e0a91e1c9154261f62cdee4525f (patch) | |
| tree | be67ec831b04cfb28cae902b6b41b581695b2502 | |
| parent | 4ce43ce019e24344f08ee6743c0efef7a03875a9 (diff) | |
fix user media permission
| -rw-r--r-- | MediaBrowser.Api/AuthorizationRequestFilterAttribute.cs | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/MediaBrowser.Api/AuthorizationRequestFilterAttribute.cs b/MediaBrowser.Api/AuthorizationRequestFilterAttribute.cs index 6cecbd0b6..6c56083cb 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; - - 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); + string userId = null; + string deviceId = null; + string device = null; + string client = null; + string version = null; + + 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 { |
