certstream-java icon indicating copy to clipboard operation
certstream-java copied to clipboard

NullPointerException on every incoming message

Open chookly314 opened this issue 5 years ago • 2 comments

Hello,

First of all, thanks for your effort in maintaining this repository.

I've recently started to get an error on every incoming message from the server (last week I would say, although I am not sure because I've been on vacations). After some debugging, the issue seems to be caused by incoming messages not having the field "as_der" in "data" -> "leaf_cert" -> "as_der", which causes a null pointer in CertStreamCertificate.java, line 37, if statement.

I imagine this is due to a recent change in the message format. My current workaround is to surround the above-mentioned if statement with a pojo.asDer != null check, but I am not sure if that would be the optimal solution.

I would appreciate if you could take a look at the error and provide me some feedback.

Thanks in advance!

chookly314 avatar Jul 24 '20 09:07 chookly314

with "My current workaround is to surround the above-mentioned if statement with a pojo.asDer != null check, but I am not sure if that would be the optimal solution." Do you mean:

if(pojo.asDer != null){ if (pojo.asDer.isEmpty()) { return null; } } ?

Because this does not work for me

DexterNano avatar Aug 05 '20 18:08 DexterNano

Hi,

Yes, that is the code I am using for the moment. Are you getting a different error?

chookly314 avatar Aug 11 '20 07:08 chookly314