Revision 2585
Added by Jing Tao about 19 years ago
src/edu/ucsb/nceas/metacat/MetaCatUtil.java | ||
---|---|---|
832 | 832 |
// Check that the user is authenticated as an administrator account |
833 | 833 |
for (int i = 0; i < list.length; i++) { |
834 | 834 |
// check the given admin dn is a group dn... |
835 |
if(list[i].startsWith("cn=")){ |
|
835 |
if(groups != null && list[i].startsWith("cn=")){
|
|
836 | 836 |
// is a group dn |
837 | 837 |
for (int j = 0; j < groups.length; j++) { |
838 | 838 |
if (groups[j].equals(list[i])) { |
... | ... | |
841 | 841 |
} |
842 | 842 |
} else { |
843 | 843 |
// is a user dn |
844 |
if (username.equals(list[i])) { |
|
844 |
if (username != null && username.equals(list[i])) {
|
|
845 | 845 |
return true; |
846 | 846 |
} |
847 | 847 |
} |
Also available in: Unified diff
Add some null checking code in onList method.