Skip to content

Commit 2e7b7b7

Browse files
committed
fix issue by catching exception if folder does not exist
1 parent 5aaeb58 commit 2e7b7b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/htmltestlogger/TxtToJSON.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ private void GenerateCaseCategoryFile()
182182
/// <returns>Returns case name(key) and categories(value)</returns>
183183
private Dictionary<string, List<string>> GetTestCaseCategories()
184184
{
185-
Dictionary<string, List<string>> testCases = new Dictionary<string, List<string>>();
185+
Dictionary<string, List<string>> testCases = new Dictionary<string, List<string>>();
186186
DirectoryInfo info = new DirectoryInfo(Directory.GetCurrentDirectory());
187187
bool existBatch = false;
188188
if (info.FullName.EndsWith("Batch"))
189189
existBatch = true;
190-
190+
191191
string fullPath = existBatch ? info.Parent.FullName : info.FullName;
192192
foreach (string dllPath in dllFiles)
193193
{
@@ -340,9 +340,9 @@ private List<string> GetCaptureFilesPath()
340340
existBatch = true;
341341
string fullPath = existBatch ? info.Parent.FullName : info.FullName;
342342
string cfgFolder = Path.Combine(fullPath, "bin");
343-
string[] ptfconfigFiles = Directory.GetFiles(cfgFolder, "*.ptfconfig", SearchOption.TopDirectoryOnly);
344343
try
345344
{
345+
string[] ptfconfigFiles = Directory.GetFiles(cfgFolder, "*.ptfconfig", SearchOption.TopDirectoryOnly);
346346
foreach (string configFile in ptfconfigFiles)
347347
{
348348
XmlDocument configXml = new XmlDocument();

0 commit comments

Comments
 (0)