From: Olivier Lamy Date: Tue, 22 Jan 2013 14:46:27 +0000 (+0000) Subject: NPE free X-Git-Tag: archiva-1.4-M4~274 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e50dcce6e30779bcae08ab73a89d6255d6558abf;p=archiva.git NPE free git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1436973 13f79535-47bb-0310-9956-ffa450edef68 --- 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; }