Project

General

Profile

« Previous | Next » 

Revision 6412

check session != null before checking authorization

View differences:

src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
568 568
    
569 569
    // get the subjects from the session
570 570
    List<Subject> subjects = new ArrayList<Subject>();
571
    Subject subject = session.getSubject();
572
    if (subject != null) {
573
    	subjects.add(subject);
571
    if (session != null) {
572
	    Subject subject = session.getSubject();
573
	    if (subject != null) {
574
	    	subjects.add(subject);
575
	    }
576
	    SubjectList subjectList = session.getSubjectList();
577
	    if (subjectList != null) {
578
	    	List<Person> personList = subjectList.getPersonList();
579
	    	if (personList != null) {
580
			    for (Person p: personList) {
581
			      subjects.add(p.getSubject());
582
			    }
583
	    	}
584
	    	List<Group> groupList = subjectList.getGroupList();
585
	    	if (groupList != null) {
586
			    for (Group g: groupList) {
587
			      subjects.add(g.getSubject());
588
			    }
589
	    	}
590
	    }
574 591
    }
575
    SubjectList subjectList = session.getSubjectList();
576
    if (subjectList != null) {
577
    	List<Person> personList = subjectList.getPersonList();
578
    	if (personList != null) {
579
		    for (Person p: personList) {
580
		      subjects.add(p.getSubject());
581
		    }
582
    	}
583
    	List<Group> groupList = subjectList.getGroupList();
584
    	if (groupList != null) {
585
		    for (Group g: groupList) {
586
		      subjects.add(g.getSubject());
587
		    }
588
    	}
589
    }
590 592
    
591 593
    // add public subject
592 594
    Subject publicSubject = new Subject();

Also available in: Unified diff