Merge pull request #383 from Kitzanos/ndg-null-check-prod
Cherry-pick ( Applied null checks in NDG flow)
This commit is contained in:
@@ -560,10 +560,12 @@ public class AppointmentDao {
|
||||
}else {
|
||||
ndgResponse = retrieveNdgByVatNumber(company.getVatNumber(), authorizationToken, hub, application,company);
|
||||
}
|
||||
if(ndgResponse!=null) {
|
||||
if (isNdgValid(ndgResponse.getNdg())) {
|
||||
saveNdg(application, company, ndgResponse.getNdg());
|
||||
log.info("NDG successfully generated for applicationId: {}", applicationId);
|
||||
} else {
|
||||
}
|
||||
}else {
|
||||
log.info("Polling for NDG for applicationId: {}", applicationId);
|
||||
handleNdgPolling(application, company, hub, authorizationToken);
|
||||
}
|
||||
@@ -743,6 +745,9 @@ public class AppointmentDao {
|
||||
String responseJson = getNdgFromExternalService(vatNumber, authorizationToken);
|
||||
// Parse and return the NDG response
|
||||
AppointmentLoginResponse loginResponse=parseNdgResponse(responseJson);
|
||||
if(loginResponse==null){
|
||||
return null;
|
||||
}
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
JsonNode rootNode = null;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user