Skip to content

Commit a5fa012

Browse files
author
Robert Fink
authored
Fix NPE when serializing Arg with null value (#73)
1 parent 0c86188 commit a5fa012

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

errors/src/main/java/com/palantir/remoting/api/errors/SerializableError.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.palantir.logsafe.Arg;
2424
import java.io.Serializable;
2525
import java.util.Map;
26+
import java.util.Objects;
2627
import org.immutables.value.Value;
2728

2829
/**
@@ -116,7 +117,7 @@ public static SerializableError forException(ServiceException exception) {
116117
.errorInstanceId(exception.getErrorInstanceId());
117118

118119
for (Arg<?> arg : exception.getArgs()) {
119-
builder.putParameters(arg.getName(), arg.getValue().toString());
120+
builder.putParameters(arg.getName(), Objects.toString(arg.getValue()));
120121
}
121122

122123
return builder.build();

0 commit comments

Comments
 (0)