Avoid a NPE if no password was given - use the default office one instead
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1494571 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7117fe26ad
commit
d80ec206c6
@ -96,6 +96,11 @@ public abstract class Decryptor {
|
||||
|
||||
protected byte[] hashPassword(EncryptionInfo info,
|
||||
String password) throws NoSuchAlgorithmException {
|
||||
// If no password was given, use the default
|
||||
if (password == null) {
|
||||
password = DEFAULT_PASSWORD;
|
||||
}
|
||||
|
||||
MessageDigest sha1 = MessageDigest.getInstance("SHA-1");
|
||||
byte[] bytes;
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user