public void checkRegisteredService(final String service) {
        if (service != null && !services.containsKey(service))
            throw new IllegalArgumentException("Unrecognized service: " + service);
    }
Check for non-null and registered.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/service/ServiceRegistry.java