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.

Assignee

Stephen Marquard

Reporter

Stephen Marquard

Severity

Incorrectly Functioning Without Workaround

Tags (folksonomy)

None

Components

Affects versions

Priority

Major
Configure