Skip to content

Commit e2c0ee6

Browse files
committed
fix NPE
1 parent 9b3701a commit e2c0ee6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/MoshiSnapshotHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ public void toJson(JsonWriter jsonWriter, CapturedContext.CapturedThrowable valu
546546
jsonWriter.value(value.getType());
547547
jsonWriter.name(MESSAGE);
548548
String msg = value.getMessage();
549-
if (msg.length() > MAX_EXCEPTION_MESSAGE_LENGTH) {
549+
if (msg != null && msg.length() > MAX_EXCEPTION_MESSAGE_LENGTH) {
550550
msg = msg.substring(0, MAX_EXCEPTION_MESSAGE_LENGTH);
551551
}
552552
jsonWriter.value(msg);

0 commit comments

Comments
 (0)