quarkusio/quarkus · error · IllegalArgumentException

`member` cannot be `null`

Error message

`member` cannot be `null`

What it means

GeoSearchStoreArgs.fromMember(member) requires a non-null member since it becomes the FROMMEMBER origin of the GEOSEARCHSTORE command. Passing null would produce an invalid Redis command, so the library fails fast with IllegalArgumentException.

Source

Thrown at extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/geo/GeoSearchStoreArgs.java:40

    private GeoUnit unit;

    private long count = -1;
    private boolean any;

    /**
     * The direction (ASC or DESC)
     */
    private String direction;

    /**
     * Use the position of the given existing {@code member} in the sorted set.
     *
     * @param member the member, must not be {@code null}
     * @return the current {@code GeoSearchStoreArgs}
     */
    public GeoSearchStoreArgs<V> fromMember(V member) {
        if (member == null) {
            throw new IllegalArgumentException("`member` cannot be `null`");
        }
        this.member = member;
        return this;
    }

    /**
     * Use the given {@code longitude} and {@code latitude} position.
     *
     * @param longitude the longitude
     * @param latitude the latitude
     * @return the current {@code GeoSearchStoreArgs}
     */
    private GeoSearchStoreArgs<V> fromCoordinate(double longitude, double latitude) {
        this.longitude = longitude;
        this.latitude = latitude;
        return this;
    }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Pass a non-null member name that exists in the geoset
  2. Guard the value before calling fromMember and skip the search if null
  3. Log/handle the null case upstream instead of passing it into the args builder

Example fix

// before
String member = members.get(name); // may be null
args.fromMember(member);
// after
String member = members.get(name);
if (member != null) {
    args.fromMember(member);
}
Defensive patterns

Strategy: validation

Validate before calling

Objects.requireNonNull(member, "member must not be null");
args.fromMember(member);

Type guard

boolean isValidMember(V member) { return member != null; }

Try / catch

try {
    args.fromMember(member);
} catch (IllegalArgumentException e) {
    log.warn("Skipping geoSearchStore: member is null");
}

Prevention

When it happens

Trigger: Calling geoSearchStore(...).fromMember(null), typically because the member variable was null (missing key entry, failed lookup, unmapped optional).

Common situations: A map lookup for the member returned null; a record/DTO field defaulted to null; refactoring changed a guaranteed member into an Optional that is passed raw.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/c10dc70fb177a584. Report an issue: GitHub.