ICEfaces
  1. ICEfaces
  2. ICE-3417

formattedSelectedValue is accessed without checking if its value is null

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.7.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      All

      Description

      Hi,
      I'm using ICEFaces 1.7.1.
      In the following method:

      com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.isSelected(Object, Object, FacesContext, UIComponent)

      at line 478 a NullPointerException occurs.
      The problem is that the variable formattedSelectedValue is accessed without checking if its value is null:

      else if (formattedSelectedValue.equals(formattedSentinel))

      This situation is very uncommon in most cases, but in my application a Converter can return a null value when is executed and this is the reason why the NPE occurs.
      In fact, "nextSelectedValue" is not null, but the following line of code returns null (line 462 in MenuRenderer) because the registered Converter returns null:

      formattedSelectedValue = formatComponentValue(facesContext, uiComponent, nextSelectedValue);

      I've modified ICEFaces sources with this little fix and now every thing seems working fine:

      } else if (formattedSelectedValue!=null && formattedSelectedValue.equals(formattedSentinel)) {

      I hope you can fix this in the next version of ICEFaces.

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #17403 Fri Aug 22 10:43:47 MDT 2008 yip.ng ICE-3417
        Changed to check for return of null from converter.
        Files Changed
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/MenuRenderer.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #17402 Fri Aug 22 10:42:38 MDT 2008 yip.ng ICE-3417
        Changed to check for return of null from converter.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/MenuRenderer.java

          People

          • Assignee:
            Unassigned
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: