New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String property can be empty #782
String property can be empty #782
Conversation
…hat they are encrypted instead of not shown
if (type == PropertyType.STRING) { | ||
// a String value can be empty | ||
value = ""; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else is unnecessary if it's not a string then we always want the exception which terminates.
throw new NullPointerException (CoreMessageConstants.EXC_PROP_VAL_NULL); | ||
if (type == PropertyType.STRING) { | ||
// a String value can be empty | ||
value = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at the Codacy feedback. It might be a good idea not to reassign value
and add an intermediary value instead. Parameter mutation is rarely a good thing ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @carlwilson
In PDF files the String Properties like Title can be empty. Now the value is null and will give a nullpointerexception when that happens. I updated the jHove Property, but I could also only update the addStringProperty in PDF module.
Sam