Project

General

Profile

« Previous | Next » 

Revision 5abafe6a

Added by Andreas Kohlbecker over 3 years ago

fixing NPE in RegistrationDTOController when identifier is not found

View differences:

cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/RegistrationDTOController.java
111 111
            HttpServletResponse response) throws IOException {
112 112

  
113 113
        logger.info("doGetByIdentifier() " + requestPathAndQuery(request));
114
        return pageRegistrationDTOs(identifier, true, 0, 2, response).getRecords().get(0);
114
        Pager<RegistrationDTO> registrationDTOsPager = pageRegistrationDTOs(identifier, true, 0, 2, response);
115
        if(registrationDTOsPager == null) {
116
            HttpStatusMessage.create("No registration found for " + identifier + " ", HttpServletResponse.SC_NOT_FOUND).send(response);
117
            return null;
118
        } else {
119
            return registrationDTOsPager.getRecords().get(0);
120
        }
115 121
    }
116 122

  
117 123
    @ApiImplicitParams({

Also available in: Unified diff