From e8ad30578b04927694a4b4ba3b3c1bed2d18be7a Mon Sep 17 00:00:00 2001 From: Sergey Plashenko Date: Mon, 14 May 2018 12:04:35 +0300 Subject: [PATCH] Fix for the issue --- .../zzz/Sitecore.Support.201408.config | 1 + .../Rules/RuleDeviceInformationManager.cs | 10 +++-- .../Sitecore.Support.201408.csproj | 39 ++++++++++++++++++- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/Sitecore.Support.201408/App_Config/Include/zzz/Sitecore.Support.201408.config b/src/Sitecore.Support.201408/App_Config/Include/zzz/Sitecore.Support.201408.config index 07a20b1..523eacc 100644 --- a/src/Sitecore.Support.201408/App_Config/Include/zzz/Sitecore.Support.201408.config +++ b/src/Sitecore.Support.201408/App_Config/Include/zzz/Sitecore.Support.201408.config @@ -1,4 +1,5 @@ + \ No newline at end of file diff --git a/src/Sitecore.Support.201408/CES/DeviceDetection/Rules/RuleDeviceInformationManager.cs b/src/Sitecore.Support.201408/CES/DeviceDetection/Rules/RuleDeviceInformationManager.cs index e006e9b..51ca66c 100644 --- a/src/Sitecore.Support.201408/CES/DeviceDetection/Rules/RuleDeviceInformationManager.cs +++ b/src/Sitecore.Support.201408/CES/DeviceDetection/Rules/RuleDeviceInformationManager.cs @@ -1,6 +1,4 @@ - - -using System; +using System; using Sitecore.Analytics; using Sitecore.CES.DeviceDetection; using Sitecore.CES.DeviceDetection.Exceptions; @@ -37,7 +35,11 @@ public string GetExtendedProperty(RuleContext ruleContext, string propertyName) private string GetUserAgentFromDeviceRuleContext(DeviceRuleContext deviceRuleContext) { Assert.ArgumentNotNull(deviceRuleContext, "deviceRuleContext"); - Assert.IsNotNull(deviceRuleContext.HttpContext, "deviceRuleContext.HttpContext is null"); + if (deviceRuleContext.HttpContext == null) + { + return null; + } + Assert.IsNotNull(deviceRuleContext.HttpContext.Request, "deviceRuleContext.HttpContext.Request is null"); return deviceRuleContext.HttpContext.Request.UserAgent; } diff --git a/src/Sitecore.Support.201408/Sitecore.Support.201408.csproj b/src/Sitecore.Support.201408/Sitecore.Support.201408.csproj index 60c1ef1..5b20c1b 100644 --- a/src/Sitecore.Support.201408/Sitecore.Support.201408.csproj +++ b/src/Sitecore.Support.201408/Sitecore.Support.201408.csproj @@ -1,4 +1,4 @@ - + @@ -41,10 +41,26 @@ 4 + + ..\packages\SC.Sitecore.Analytics.9.0.0\lib\Sitecore.Analytics.dll + False + + + ..\packages\SC.Sitecore.CES.DeviceDetection.9.0.0\lib\Sitecore.CES.DeviceDetection.dll + False + + + ..\packages\SC.Sitecore.CES.DeviceDetection.Rules.9.0.0\lib\Sitecore.CES.DeviceDetection.Rules.dll + False + ..\packages\SC.Sitecore.Kernel.9.0.0\lib\Sitecore.Kernel.dll False + + ..\packages\SC.Sitecore.Xdb.Configuration.9.0.0\lib\Sitecore.Xdb.Configuration.dll + False + @@ -52,6 +68,7 @@ + @@ -68,4 +85,22 @@ - + + + + + True + True + 0 + / + http://localhost:54036/ + False + False + + + False + + + + + \ No newline at end of file