Skip to content

Commit

Permalink
Set FilePart properties for directory type
Browse files Browse the repository at this point in the history
  • Loading branch information
Erior committed Sep 23, 2023
1 parent 7764684 commit bc3bb2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SharpCompress/Common/SevenZip/SevenZipFilePart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public CompressionType CompressionType

internal CompressionType GetCompression()
{
if( Header.IsDir ) return CompressionType.None;

var coder = Folder!._coders.First();
switch (coder._methodId._id)
{
Expand All @@ -97,5 +99,5 @@ internal CompressionType GetCompression()
}

internal bool IsEncrypted =>
Folder!._coders.FindIndex(c => c._methodId._id == CMethodId.K_AES_ID) != -1;
Header.IsDir ? false : Folder!._coders.FindIndex(c => c._methodId._id == CMethodId.K_AES_ID) != -1;
}

0 comments on commit bc3bb2d

Please sign in to comment.