Skip to content

Commit 21f1895

Browse files
committed
Bugfix: empty folder
1 parent 26c36e8 commit 21f1895

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

SvgToXaml/SvgToXaml.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@
2929
</PropertyGroup>
3030
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3131
<PlatformTarget>AnyCPU</PlatformTarget>
32-
<DebugType>pdbonly</DebugType>
32+
<DebugType>none</DebugType>
3333
<Optimize>true</Optimize>
3434
<OutputPath>bin\Release\</OutputPath>
3535
<DefineConstants>TRACE</DefineConstants>
3636
<ErrorReport>prompt</ErrorReport>
3737
<WarningLevel>4</WarningLevel>
3838
<Prefer32Bit>false</Prefer32Bit>
39+
<UseVSHostingProcess>true</UseVSHostingProcess>
3940
</PropertyGroup>
4041
<PropertyGroup>
4142
<StartupObject>SvgToXaml.Program</StartupObject>

SvgToXaml/ViewModels/SvgImagesViewModel.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,16 @@ private void ReadImagesFromDir(string folder)
126126

127127
private static string[] GetFilesMulti(string sourceFolder, string filters, System.IO.SearchOption searchOption = SearchOption.TopDirectoryOnly)
128128
{
129-
return filters.Split('|').SelectMany(filter => System.IO.Directory.GetFiles(sourceFolder, filter, searchOption)).ToArray();
129+
try
130+
{
131+
if (!Directory.Exists(sourceFolder))
132+
return new string[0];
133+
return filters.Split('|').SelectMany(filter => Directory.GetFiles(sourceFolder, filter, searchOption)).ToArray();
134+
}
135+
catch (Exception)
136+
{
137+
return new string[0];
138+
}
130139
}
131140
}
132141
}

0 commit comments

Comments
 (0)