Skip to content

Commit

Permalink
Modified the implicit cast from DirectoryInfo to DirectoryInfoBase to…
Browse files Browse the repository at this point in the history
… correctly return null if asked to cast a null value

Signed-off-by: Martin Evans <[email protected]>
  • Loading branch information
martindevans committed Apr 17, 2013
1 parent 2532798 commit 4e390b1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions System.IO.Abstractions/DirectoryInfoBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public abstract class DirectoryInfoBase : FileSystemInfoBase

public static implicit operator DirectoryInfoBase(DirectoryInfo directoryInfo)
{
if (directoryInfo == null)
return null;
return new DirectoryInfoWrapper(directoryInfo);
}
}
Expand Down
6 changes: 3 additions & 3 deletions System.IO.Abstractions/System.IO.Abstractions.ncrunchproject
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>60000</DefaultTestTimeout>
<UseBuildConfiguration />
<UseBuildPlatform />
<ProxyProcessPath />
<UseBuildConfiguration></UseBuildConfiguration>
<UseBuildPlatform></UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
</ProjectConfiguration>
12 changes: 6 additions & 6 deletions TestingHelpers/TestingHelpers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StringExtensions.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\System.IO.Abstractions\System.IO.Abstractions.csproj">
<Project>{4D398F3A-0784-4401-93CD-46CD2FBD6B92}</Project>
<Name>System.IO.Abstractions</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
Expand All @@ -113,6 +107,12 @@
<ItemGroup>
<None Include="TestingHelpers.nuspec" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\System.IO.Abstractions\System.IO.Abstractions.csproj">
<Project>{4D398F3A-0784-4401-93CD-46CD2FBD6B92}</Project>
<Name>System.IO.Abstractions</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
6 changes: 3 additions & 3 deletions TestingHelpers/TestingHelpers.ncrunchproject
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>60000</DefaultTestTimeout>
<UseBuildConfiguration />
<UseBuildPlatform />
<ProxyProcessPath />
<UseBuildConfiguration></UseBuildConfiguration>
<UseBuildPlatform></UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
</ProjectConfiguration>

0 comments on commit 4e390b1

Please sign in to comment.