Catch null log message

Steps to reproduce

A pattern like:

logger.warn(e.getMessage());

can produce an NPE in the logging code if getMessage() is null:

java.lang.NullPointerException
at org.opencastproject.util.Log.convertCurlyBraces(Log.java:221)[161:matterhorn-common:2.3.0.SNAPSHOT]
at org.opencastproject.util.Log.log(Log.java:200)[161:matterhorn-common:2.3.0.SNAPSHOT]
at org.opencastproject.util.Log.warn(Log.java:175)[161:matterhorn-common:2.3.0.SNAPSHOT]

While the calling code should be fixed, we also shouldn't NPE in the logging code itself.

Fixed and reviewed
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Stephen Marquard

Reporter

Stephen Marquard

Severity

Incorrectly Functioning Without Workaround