Skip to content

Commit

Permalink
Bugfix: empty folder
Browse files Browse the repository at this point in the history
  • Loading branch information
BerndK committed May 6, 2015
1 parent 26c36e8 commit 21f1895
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion SvgToXaml/SvgToXaml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<UseVSHostingProcess>true</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup>
<StartupObject>SvgToXaml.Program</StartupObject>
Expand Down
11 changes: 10 additions & 1 deletion SvgToXaml/ViewModels/SvgImagesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,16 @@ private void ReadImagesFromDir(string folder)

private static string[] GetFilesMulti(string sourceFolder, string filters, System.IO.SearchOption searchOption = SearchOption.TopDirectoryOnly)
{
return filters.Split('|').SelectMany(filter => System.IO.Directory.GetFiles(sourceFolder, filter, searchOption)).ToArray();
try
{
if (!Directory.Exists(sourceFolder))
return new string[0];
return filters.Split('|').SelectMany(filter => Directory.GetFiles(sourceFolder, filter, searchOption)).ToArray();
}
catch (Exception)
{
return new string[0];
}
}
}
}

0 comments on commit 21f1895

Please sign in to comment.