Skip to content

DefaultReactiveHashOperations$$Lambda$1949/0x0000000801666b30] returned a null value. #3031

@wang-sheng-pu1002

Description

@wang-sheng-pu1002

The mapper [org.springframework.data.redis.core.DefaultReactiveHashOperations$$Lambda$1949/0x0000000801666b30] returned a null value.
java.lang.NullPointerException: The mapper [org.springframework.data.redis.core.DefaultReactiveHashOperations$$Lambda$1949/0x0000000801666b30] returned a null value.
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:108)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

The above is my error message

My partial code

private Mono<Boolean> getExpertSystemFlag(String key) {
    return reactiveRedisTemplate.opsForHash().get(key, "sessionAttr:AAA")
            .flatMap(systemFlag -> {
                return Mono.just(systemFlagList.contains(systemFlag));
            })
            .switchIfEmpty(Mono.defer(() -> {
                return Mono.just(false);
            }));
}

When I confirm the existence of this key primary key in Redis, but there is no sessionAttr: AAA object in it, I occasionally encounter an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions