1. opensymphony
  2. xwork


plightbo  committed 5f14265

WW-1055: better logging

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@734e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits b80cb60
  • Branches master

Comments (0)

Files changed (1)

File src/java/com/opensymphony/xwork/util/OgnlUtil.java

View file
  • Ignore whitespace
      *                   note if exclusions AND inclusions are supplied and not null nothing will get copied.
     public static void copy(Object from, Object to, Map context, Collection exclusions, Collection inclusions) {
+        if (from == null || to == null) {
+            log.warn("Attempting to copy from or to a null source. This is illegal and is bein skipped. This may be due to an error in an OGNL expression, action chaining, or some other event.");
+            return;
+        }
         Map contextFrom = Ognl.createDefaultContext(from);
         Ognl.setTypeConverter(contextFrom, XWorkConverter.getInstance());
         Map contextTo = Ognl.createDefaultContext(to);