#vulnerable code 
                                @Override
    public int accept(int... httpStatus) throws AcmeException {
        assertConnectionIsOpen();

        try {
            int rc = conn.getResponseCode();
            OptionalInt match = Arrays.stream(httpStatus).filter(s -> s == rc).findFirst();
            if (match.isPresent()) {
                return match.getAsInt();
            }

            if (!"application/problem+json".equals(conn.getHeaderField(CONTENT_TYPE_HEADER))) {
                throw new AcmeException("HTTP " + rc + ": " + conn.getResponseMessage());
            }

            JSON json = readJsonResponse();

            if (rc == HttpURLConnection.HTTP_CONFLICT) {
                throw new AcmeConflictException(json.get("detail").asString(), getLocation());
            }

            throw createAcmeException(json);
        } catch (IOException ex) {
            throw new AcmeNetworkException(ex);
        }
    } 
                            #location 19 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Override
    public int accept(int... httpStatus) throws AcmeException {
        assertConnectionIsOpen();

        try {
            int rc = conn.getResponseCode();
            OptionalInt match = Arrays.stream(httpStatus).filter(s -> s == rc).findFirst();
            if (match.isPresent()) {
                return match.getAsInt();
            }

            if (!"application/problem+json".equals(conn.getHeaderField(CONTENT_TYPE_HEADER))) {
                throw new AcmeException("HTTP " + rc + ": " + conn.getResponseMessage());
            }

            throw createAcmeException(readJsonResponse());
        } catch (IOException ex) {
            throw new AcmeNetworkException(ex);
        }
    }