Ian Boston created DS-1416:
------------------------------

             Summary: 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


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

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to