open-eid / digidoc4j

DigiDoc for Java. Javadoc:
http://open-eid.github.io/digidoc4j
GNU Lesser General Public License v2.1
73 stars 39 forks source link

Fixed NPE for the cases when signature producion data is missing. #5

Closed informatik01 closed 9 years ago

informatik01 commented 9 years ago

We must check for null when fetching signature production data from a DDocSignature, because SignatureProductionPlace element is OPTIONAL according to the XAdES specification.

Concrete use case where I have encountered this issue: opening a container from a DigiDoc file with a signature that had no location data. After getting the signature from this container and trying to get some signature production data (e.g. signature.getCity()) a NullPointerException was thrown.

rvillido commented 9 years ago

Thank you for fixing the nullpointers. I merged the changes and it will be available with the next release. Sorry for the delay.

informatik01 commented 9 years ago

It's OK, no problem ))