Skip to content

Commit

Permalink
[sre] Avoid NPE into the SRE JUL formatter.
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Nov 27, 2020
1 parent 4c1824c commit cff9cd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -98,7 +98,7 @@ class JulPatternFormatter extends Formatter {
/** Filter the log name in order to computer the one that is displayed into the log.
*
* @param logName the log name to filter.
* @return the displyable log name.
* @return the displayable log name.
*/
protected def filterLogName(logName : String) : String {
logName
Expand Down
Expand Up @@ -43,7 +43,10 @@ import io.sarl.util.JulPatternFormatter
class SreJulPatternFormatter extends JulPatternFormatter {

protected override filterLogName(logName : String) : String {
logName.replaceFirst("^" + Pattern::quote(JulLoggerCreator::PLATFORM_LOGGER_NAME_PREFIX), "")
if (logName === null) {
return null
}
return logName.replaceFirst("^" + Pattern::quote(JulLoggerCreator::PLATFORM_LOGGER_NAME_PREFIX), "")
}

}

0 comments on commit cff9cd9

Please sign in to comment.