[richfaces-issues] [JBoss JIRA] (RF-12661) rich:tooltip causes NPE with null value
Raimundas Maknys (JIRA)
jira-events at lists.jboss.org
Thu Dec 13 11:06:17 EST 2012
Raimundas Maknys created RF-12661:
-------------------------------------
Summary: 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
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