Check for null certificate on validCertificate
Merge branch 'bug/NullPointer-in-validCertificate-#6582' into develop