Skip to content

Commit 8b1aace

Browse files
committed
Fix
1 parent cedea96 commit 8b1aace

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

parquet/src/file/metadata/writer.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -636,22 +636,21 @@ impl MetadataObjectWriter {
636636
}
637637

638638
fn get_footer_encryption_algorithm(&self) -> Option<EncryptionAlgorithm> {
639-
let file_encryptor = self.file_encryptor.as_ref().unwrap();
640-
if !file_encryptor.properties().encrypt_footer() {
639+
if let Some(file_encryptor) = &self.file_encryptor {
641640
let supply_aad_prefix = file_encryptor
642641
.properties()
643642
.aad_prefix()
644643
.map(|_| !file_encryptor.properties().store_aad_prefix());
645-
let encryption_algorithm = Some(EncryptionAlgorithm::AESGCMV1(AesGcmV1 {
644+
let encryption_algorithm = EncryptionAlgorithm::AESGCMV1(AesGcmV1 {
646645
aad_prefix: if file_encryptor.properties().store_aad_prefix() {
647646
file_encryptor.properties().aad_prefix().cloned()
648647
} else {
649648
None
650649
},
651650
aad_file_unique: Some(file_encryptor.aad_file_unique().clone()),
652651
supply_aad_prefix,
653-
}));
654-
return encryption_algorithm;
652+
});
653+
return Some(encryption_algorithm);
655654
}
656655
None
657656
}

0 commit comments

Comments
 (0)