Repository: tapestry-5
Updated Branches:
  refs/heads/master 33f9e65b9 -> c4202982a


TAP5-2500: throw an exception if the Label component cannot retrieve the 
Field's client id


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/c4202982
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/c4202982
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/c4202982

Branch: refs/heads/master
Commit: c4202982a11925b656e595cce4a276530e9c47d7
Parents: 33f9e65
Author: Jochen Kemnade <[email protected]>
Authored: Thu Sep 10 10:27:22 2015 +0200
Committer: Jochen Kemnade <[email protected]>
Committed: Thu Sep 10 10:27:22 2015 +0200

----------------------------------------------------------------------
 .../java/org/apache/tapestry5/corelib/components/Label.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c4202982/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Label.java
----------------------------------------------------------------------
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Label.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Label.java
index 5610131..44a32b9 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Label.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Label.java
@@ -80,8 +80,12 @@ public class Label
     {
         String fieldId = field.getClientId();
 
-        labelElement.forceAttributes("for", fieldId);
+        if (fieldId == null)
+        {
+            throw new IllegalStateException("The field has returned a null 
client-side ID");
+        }
 
+        labelElement.forceAttributes("for", fieldId);
         decorator.insideLabel(field, labelElement);
     }
 

Reply via email to