From e50dcce6e30779bcae08ab73a89d6255d6558abf Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 22 Jan 2013 14:46:27 +0000 Subject: [PATCH] NPE free git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1436973 13f79535-47bb-0310-9956-ffa450edef68 --- .../web/api/DefaultJavascriptLogger.java | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultJavascriptLogger.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultJavascriptLogger.java index 0594a5f18..37a320a2f 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultJavascriptLogger.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultJavascriptLogger.java @@ -27,7 +27,7 @@ import org.springframework.stereotype.Service; * @author Olivier Lamy * @since 1.4-M4 */ -@Service( "javascriptLogger#default" ) +@Service("javascriptLogger#default") public class DefaultJavascriptLogger implements JavascriptLogger { @@ -37,7 +37,10 @@ public class DefaultJavascriptLogger { Logger toUse = javascriptLog.getLoggerName() == null ? logger : LoggerFactory.getLogger( javascriptLog.getLoggerName() ); - + if ( javascriptLog.getMessage() == null ) + { + return Boolean.TRUE; + } toUse.trace( javascriptLog.getMessage() ); return Boolean.TRUE; } @@ -47,6 +50,11 @@ public class DefaultJavascriptLogger Logger toUse = javascriptLog.getLoggerName() == null ? logger : LoggerFactory.getLogger( javascriptLog.getLoggerName() ); + if ( javascriptLog.getMessage() == null ) + { + return Boolean.TRUE; + } + toUse.debug( javascriptLog.getMessage() ); return Boolean.TRUE; } @@ -56,6 +64,11 @@ public class DefaultJavascriptLogger Logger toUse = javascriptLog.getLoggerName() == null ? logger : LoggerFactory.getLogger( javascriptLog.getLoggerName() ); + if ( javascriptLog.getMessage() == null ) + { + return Boolean.TRUE; + } + toUse.info( javascriptLog.getMessage() ); return Boolean.TRUE; } @@ -65,6 +78,11 @@ public class DefaultJavascriptLogger Logger toUse = javascriptLog.getLoggerName() == null ? logger : LoggerFactory.getLogger( javascriptLog.getLoggerName() ); + if ( javascriptLog.getMessage() == null ) + { + return Boolean.TRUE; + } + toUse.warn( javascriptLog.getMessage() ); return Boolean.TRUE; } @@ -74,6 +92,11 @@ public class DefaultJavascriptLogger Logger toUse = javascriptLog.getLoggerName() == null ? logger : LoggerFactory.getLogger( javascriptLog.getLoggerName() ); + if ( javascriptLog.getMessage() == null ) + { + return Boolean.TRUE; + } + toUse.error( javascriptLog.getMessage() ); return Boolean.TRUE; } -- 2.39.5