Skip to content

Possible NullPointerException in DelegateJsonObject #3417

@brushmate

Description

@brushmate

Bug Report

Current Behavior

When passing a non-existing key to DelegateJsonObject#remove a NullPointerException will be thrown, because DelegateJsonValue#wrap does not allow null values as input.

Input Code

Input Code
@Override
public JsonValue remove(String key) {
    JsonNode value = ((ObjectNode) node).remove(key);

    return wrap(value);
}

Expected behavior/code

When passing a non-existing key to DelegateJsonObject#remove, null should be returned.

Environment

  • Lettuce version(s): 6.8.0.RELEASE and up
  • Redis version: any

Possible Solution

Guard the the call to DelegateJsonValue#wrap with a null check.

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions