Skip to content

Commit

Permalink
Fix for the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sc-spl committed May 14, 2018
1 parent c6278b4 commit e8ad305
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone OR ContentManagement OR ContentDelivery OR Processing OR Reporting">
<RuleDeviceInformationManager type="Sitecore.Support.CES.DeviceDetection.Rules.RuleDeviceInformationManager, Sitecore.Support.201408" />
</sitecore>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@


using System;
using System;
using Sitecore.Analytics;
using Sitecore.CES.DeviceDetection;
using Sitecore.CES.DeviceDetection.Exceptions;
Expand Down Expand Up @@ -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;
}
Expand Down
39 changes: 37 additions & 2 deletions src/Sitecore.Support.201408/Sitecore.Support.201408.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -41,17 +41,34 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Sitecore.Analytics, Version=11.18.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SC.Sitecore.Analytics.9.0.0\lib\Sitecore.Analytics.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.CES.DeviceDetection, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SC.Sitecore.CES.DeviceDetection.9.0.0\lib\Sitecore.CES.DeviceDetection.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.CES.DeviceDetection.Rules, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SC.Sitecore.CES.DeviceDetection.Rules.9.0.0\lib\Sitecore.CES.DeviceDetection.Rules.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.Kernel">
<HintPath>..\packages\SC.Sitecore.Kernel.9.0.0\lib\Sitecore.Kernel.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.Xdb.Configuration, Version=11.40.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SC.Sitecore.Xdb.Configuration.9.0.0\lib\Sitecore.Xdb.Configuration.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
</ItemGroup>
<ItemGroup>
<Compile Include="CES\DeviceDetection\Rules\RuleDeviceInformationManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand All @@ -68,4 +85,22 @@
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
</Project>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:54036/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>

0 comments on commit e8ad305

Please sign in to comment.