-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 6.0, 7.10, 8.10, 9.1
-
Component/s: Local Configuration
-
Backlog priority:550
-
Sprint:nxfit 9.2.5
-
Story Points:5
It can happen (unable to reproduce but encountered by customer) that a NPE occurs when sorting document types in class UITypesConfigurationActions, here is a diff (6.0) I provided in a patched jar to the customer:
diff --git a/nuxeo-features/localconf/nuxeo-localconf-web/src/main/java/org/nuxeo/ecm/localconf/UITypesConfigurationActions.java b/nuxeo-features/localconf/nuxeo-localconf-web/src/main/java/org/nuxeo/ecm/localconf/UITypesConfigurationActions.java index dfb7f99..5982c47 100644 --- a/nuxeo-features/localconf/nuxeo-localconf-web/src/main/java/org/nuxeo/ecm/localconf/UITypesConfigurationActions.java +++ b/nuxeo-features/localconf/nuxeo-localconf-web/src/main/java/org/nuxeo/ecm/localconf/UITypesConfigurationActions.java @@ -28,6 +28,8 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.jboss.seam.annotations.In; import org.jboss.seam.annotations.Install; import org.jboss.seam.annotations.Name; @@ -55,6 +57,8 @@ public class UITypesConfigurationActions implements Serializable { private static final long serialVersionUID = 1L; + private static final Log log = LogFactory.getLog(UITypesConfigurationActions.class); + @In(create = true) protected Map<String, String> messages; @@ -87,7 +91,15 @@ public class UITypesConfigurationActions implements Serializable { @Override public int compare(Type type1, Type type2) { String label1 = messages.get(type1.getLabel()); + if (label1 == null) { + log.error("No label for " + type1.getId()); + label1 = type1.getId(); + } String label2 = messages.get(type2.getLabel()); + if (label2 == null) { + log.error("No label for " + type2.getId()); + label2 = type2.getId(); + } return label1.compareTo(label2); } }
- is related to
-
NXS-4074 Document should not be available in the Accepted Children Types and Container Types
- Open