[ 
https://jira.duraspace.org/browse/DS-1416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=27360#comment-27360
 ] 

Peter Dietz commented on DS-1416:
---------------------------------

Not as clean as a pull-request, but I've corrected this for my local repository 
with: 
https://github.com/osulibraries/DSpace/commit/d813c11dd3329dc862d5f2b6840551565638fd5c

I'll work on a PR when I get the time.
                
> 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

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to