rogerc / file-stream-rotator

NodeJS file stream rotator
MIT License
143 stars 69 forks source link

fix: set hashType on null #87

Closed Means88 closed 2 years ago

Means88 commented 2 years ago

hashType is assigned to auditLog.hashType before null checking.

testGetStream was returned at the first statement, so the test case was muted.

rogerc commented 2 years ago

thanks for the PR. I couldn't merge it because of lots of space changes. I've published version 0.6.1 with the change and set one of the tests to not use the audit log to catch issues when not using max logs.

    // Thanks to Means88 for PR.
    if (auditLog != null) {
        auditLog.hashType = (options.audit_hash_type !== undefined ? options.audit_hash_type : 'md5');
    }