[ https://jira.duraspace.org/browse/DS-1416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Van de Velde updated DS-1416: ----------------------------------- Documentation Status: Not Required (was: Needed) Status: Code Review Needed (was: Accepted) > NPE when removing roles from Collection workflow steps > ------------------------------------------------------ > > Key: DS-1416 > URL: https://jira.duraspace.org/browse/DS-1416 > Project: DSpace > Issue Type: Bug > Components: DSpace API, XMLUI > Affects Versions: 3.0 > Reporter: Ian Boston > Assignee: Kevin Van de Velde > Fix For: 3.1 > > > In the XMLUI > If I edit a collection > Add a role to a workflow step clicking create. > Add a user to that role. > save > then delete the role from the workflow step. > I get the following NPE: > java.lang.NullPointerException > at > org.dspace.xmlworkflow.WorkflowUtils.deleteRoleGroup(WorkflowUtils.java:215) > at > org.dspace.app.xmlui.aspect.administrative.FlowContainerUtils.processDeleteCollectionRole(FlowContainerUtils.java:538) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155) > at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243) > at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3237) > The method is: > public static void deleteRoleGroup(Context context, Collection collection, > String roleID) throws SQLException, IOException, > WorkflowConfigurationException { > Workflow workflow = WorkflowFactory.getWorkflow(collection); > Role role = workflow.getRoles().get(roleID); > Line: 215>>>>>>> NPE on role if(role.getScope() == > Role.Scope.COLLECTION){ > CollectionRole ass = CollectionRole.find(context, > collection.getID(), roleID); > ass.delete(); > } > } > You could do > if ( role != null && role.getScope() ... > but role should not be null ? -- 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 ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d _______________________________________________ Dspace-devel mailing list Dspace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-devel