[richfaces-issues] [JBoss JIRA] (RF-12661) rich:tooltip causes NPE with null value
Brian Leathem (JIRA)
jira-events at lists.jboss.org
Mon Dec 17 03:13:08 EST 2012
[ https://issues.jboss.org/browse/RF-12661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741781#comment-12741781 ]
Brian Leathem commented on RF-12661:
------------------------------------
[~rmaknys] Thanks for reporting this, and for pointing out the solution. Any chance you want to take this one step further and issue a [pull request|https://community.jboss.org/wiki/GuideToUsePullRequestsWithGitHubAndJIRA]? (be sure to sign the [CLA|http://cla.jboss.org/])
> rich:tooltip causes NPE with null value
> ---------------------------------------
>
> Key: RF-12661
> URL: https://issues.jboss.org/browse/RF-12661
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component-output
> Affects Versions: 4.2.2.Final
> Reporter: Raimundas Maknys
> Priority: Minor
> Fix For: 5-Tracking
>
>
> rich:tooltip with null value causes NullPointerException:
> {code}
> Caused by: java.lang.NullPointerException
> at org.richfaces.renderkit.html.TooltipRenderer.encodeContentBegin(TooltipRenderer.java:135)
> at org.richfaces.renderkit.html.TooltipRenderer.doEncodeBegin(TooltipRenderer.java:127)
> at org.richfaces.renderkit.RendererBase.encodeBegin(RendererBase.java:115)
> at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:585)
> at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:515)
> at org.richfaces.renderkit.RendererBase.renderChildren(RendererBase.java:276)
> ...........
> {code}
> Proposed solution:
> {code:title=org.richfaces.renderkit.html.TooltipRenderer|borderStyle=solid}
> 130 private void encodeContentBegin(ResponseWriter writer, FacesContext context, AbstractTooltip tooltip) throws IOException {
> 131 writer.startElement(getMarkupElement(tooltip), tooltip);
> 132 writer.writeAttribute(ID_ATTRIBUTE, tooltip.getClientId(context) + ":content", null);
> 133 writer.writeAttribute(CLASS_ATTRIBUTE, "rf-tt-cnt", null);
> 134 if (tooltip.getChildCount() == 0) {
> - 135 writer.write(tooltip.getValue().toString());
> + 135 writer.write(tooltip.getValue() != null ? tooltip.getValue().toString() : "");
> 136 }
> 137 }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the richfaces-issues
mailing list