Skip to content

Commit 5ab7103

Browse files
committed
Move try block for deletes inside loop.
1 parent afd005b commit 5ab7103

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

RetailCoder.VBE/App.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,15 @@ private static void EnsureTempPathExists()
8989
Directory.CreateDirectory(ApplicationConstants.RUBBERDUCK_TEMP_PATH);
9090
}
9191
// The parser swallows the error if deletions fail - clean up any temp files on startup
92-
try
93-
{
94-
foreach (var file in new DirectoryInfo(ApplicationConstants.RUBBERDUCK_TEMP_PATH).GetFiles())
92+
foreach (var file in new DirectoryInfo(ApplicationConstants.RUBBERDUCK_TEMP_PATH).GetFiles())
93+
{ try
9594
{
96-
file.Delete();
95+
file.Delete();
96+
}
97+
catch
98+
{
99+
// Yeah, don't care here either.
97100
}
98-
}
99-
catch
100-
{
101-
// Yeah, don't care here either.
102101
}
103102
}
104103

0 commit comments

Comments
 (0)