Skip to content

ecs logging can throw an NPE on null exception message #92

Closed
@Funboy65

Description

@Funboy65

Hello,

Like in #44

Same thing on another method for us whith a NPE on an int compare:
java.lang.NullPointerException
at co.elastic.logging.JsonUtils.quoteAsString(JsonUtils.java:63)
at co.elastic.logging.EcsJsonSerializer.serializeFormattedMessage(EcsJsonSerializer.java:79)

In your code the null message is not tested in the JsonUtils.quoteAsString :
public static void serializeFormattedMessage(StringBuilder builder, String message) {
builder.append(""message":"");
JsonUtils.quoteAsString(message, builder);
builder.append("", ");
}

Thanks to you ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions