fix: update password index initialization in tryPassword function for correct behavior

This commit is contained in:
Moyasee
2026-01-04 21:10:37 +02:00
parent 7e7390885e
commit feb8d78e01

View File

@@ -46,7 +46,7 @@ export class SevenZip {
onProgress?: (progress: ExtractionProgress) => void
): Promise<ExtractionResult> {
return new Promise((resolve, reject) => {
const tryPassword = (index = -1) => {
const tryPassword = (index = 0) => {
const password = passwords[index] ?? "";
logger.info(
`Trying password "${password || "(empty)"}" on ${filePath}`
@@ -115,7 +115,7 @@ export class SevenZip {
});
};
tryPassword();
tryPassword(0);
});
}