brendan-duncan / archive

Dart library to encode and decode various archive and compression formats, such as Zip, Tar, GZip, ZLib, and BZip2.
MIT License
395 stars 130 forks source link

Zip encode with password creates a "Null check operator used on a null value" #318

Open tototo23 opened 5 months ago

tototo23 commented 5 months ago

When using

ZipFileEncoder(password: .....).zipDirectory(directory, ...);

To zip a folderhaving subfolders, with a password, i have a Null exception. Following the exception, it reveals that it comes from zip_encoder:355 : output.writeBytes(salt!); having salt==null. This is called from _writeFile() line 261,where salt is not initialized in this context, when the current object is a Folder and not a File