[seam-commits] Seam SVN: r10389 - trunk/src/main/org/jboss/seam/web.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Mon Apr 13 05:42:47 EDT 2009
Author: christian.bauer at jboss.com
Date: 2009-04-13 05:42:47 -0400 (Mon, 13 Apr 2009)
New Revision: 10389
Modified:
trunk/src/main/org/jboss/seam/web/LoggingFilter.java
Log:
JBSEAM-4102, LoggingFilter throws NPE
Modified: trunk/src/main/org/jboss/seam/web/LoggingFilter.java
===================================================================
--- trunk/src/main/org/jboss/seam/web/LoggingFilter.java 2009-04-12 05:22:10 UTC (rev 10388)
+++ trunk/src/main/org/jboss/seam/web/LoggingFilter.java 2009-04-13 09:42:47 UTC (rev 10389)
@@ -17,6 +17,7 @@
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.annotations.web.Filter;
import org.jboss.seam.security.Identity;
+import org.jboss.seam.security.Credentials;
/**
* This filter adds the authenticated user name to the log4j
@@ -47,7 +48,8 @@
if (attribute instanceof Identity)
{
Identity identity = (Identity) attribute;
- String username = identity.getUsername();
+ Credentials credentials = identity.getCredentials();
+ String username = credentials != null ? credentials.getUsername() : null;
if (username != null)
{
MDC.put("username", username);
More information about the seam-commits
mailing list