Skip to content

Commit

Permalink
[Fix #381] Fixing null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Nov 26, 2024
1 parent b7954b4 commit 41b6aeb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.List;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.NullNode;

import net.thisptr.jackson.jq.Expression;
import net.thisptr.jackson.jq.PathOutput;
Expand Down Expand Up @@ -38,7 +39,7 @@ public void apply(final Scope scope, final JsonNode in, final Path ipath, final
}, true);
JsonNode out = in;
for (final Path lpath : lpaths)
out = lpath.mutate(out, (lval) -> operator.apply(scope.getObjectMapper(), lval, rval));
out = lpath.mutate(out, (lval) -> operator.apply(scope.getObjectMapper(), lval == null ? NullNode.getInstance() : lval, rval));
output.emit(out, null);
});
}
Expand Down

0 comments on commit 41b6aeb

Please sign in to comment.