Skip to content

Commit 1735059

Browse files
Better fix for unit test failures, due to https://learn.microsoft.com/en-us/dotnet/api/system.io.path.getfullpath?view=net-9.0 listing several more exceptions than the other functions, most of which I would not imagine should be directly handled.
1 parent 6fd54bf commit 1735059

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

BinaryObjectScanner/FileType/InstallShieldCAB.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@ public bool Extract(string file, string outDir, bool includeDebug)
2424
/// <inheritdoc/>
2525
public bool Extract(Stream? stream, string file, string outDir, bool includeDebug)
2626
{
27-
if (file != "")
27+
try
28+
{
2829
file = Path.GetFullPath(file);
30+
}
31+
catch
32+
{
33+
// If any of the exceptions to getting a full path occur, just continue as normal. The rest of the
34+
// functions already handle the various cases upon which this would throw exceptions.
35+
}
36+
2937
// Get the name of the first cabinet file or header
3038
var directory = Path.GetDirectoryName(file);
3139
string noExtension = Path.GetFileNameWithoutExtension(file);

0 commit comments

Comments
 (0)