Skip to content

Commit

Permalink
Merge pull request #29231 Avoid potential null pointer exceptions in …
Browse files Browse the repository at this point in the history
…logging.
  • Loading branch information
robertwb authored Nov 1, 2023
2 parents 92a1a45 + 9101dc1 commit afc499f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,15 @@ public void publish(LogRecord record) {
if (severity == null) {
return;
}
if (record == null) {
return;
}
String messageString = getFormatter().formatMessage(record);

BeamFnApi.LogEntry.Builder builder =
BeamFnApi.LogEntry.newBuilder()
.setSeverity(severity)
.setMessage(getFormatter().formatMessage(record))
.setMessage(messageString == null ? "null" : messageString)
.setThread(Integer.toString(record.getThreadID()))
.setTimestamp(
Timestamp.newBuilder()
Expand Down

0 comments on commit afc499f

Please sign in to comment.