ICEfaces
  1. ICEfaces
  2. ICE-7698

NullPointerException in DOMUtils

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.RC2
    • Fix Version/s: 3.0.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      probably all environments
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Check that val is not null, i.e. change the isWhitespaceText()-Method to:

          private static boolean isWhitespaceText(Node node) {
              if (node.getNodeType() == Node.TEXT_NODE) {
                  String val = node.getNodeValue();
                  if (val != null) {
                      // Treat an empty string like whitespace
                      for (int i = val.length() - 1; i >= 0; i--) {
                          if (!Character.isWhitespace(val.charAt(i))) {
                              return false;
                          }
                      }
                      return true;
                  }
              }
              return false;
          }
      Show
      Check that val is not null, i.e. change the isWhitespaceText()-Method to:     private static boolean isWhitespaceText(Node node) {         if (node.getNodeType() == Node.TEXT_NODE) {             String val = node.getNodeValue();             if (val != null) {                 // Treat an empty string like whitespace                 for (int i = val.length() - 1; i >= 0; i--) {                     if (!Character.isWhitespace(val.charAt(i))) {                         return false;                     }                 }                 return true;             }         }         return false;     }

      Description

      When using ICEFaces together with Spring Webflow, a NullPointerException may arise at org.icefaces.impl.util.DOMUtils.isWhitespaceText(DOMUtils.java:341)

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Andreas Peer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: