Author: hlship
Date: Wed Apr 13 22:23:03 2011
New Revision: 1091943
URL: http://svn.apache.org/viewvc?rev=1091943&view=rev
Log:
TAP5-853: Don't attempt to set a value on null when the navigate method returns
null
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java?rev=1091943&r1=1091942&r2=1091943&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java
Wed Apr 13 22:23:03 2011
@@ -951,6 +951,11 @@ public class PropertyConduitSourceImpl i
{
builder.loadThis().loadArgument(0).invokeVirtual(navMethod);
+ // When the navigation method returns null, we do nothing
(error checking is inside
+ // the navigation method).
+
+ builder.dupe(0).ifNull(RETURN_RESULT, null);
+
String typeName =
PlasticUtils.toTypeName(GenericsUtils.asClass(info.getType()));
builder.loadArgument(1).castOrUnbox(typeName);