Rod Widdowson wrote:
> Nullnss is a different capability from presense. In the example I
> think you'll find that memberOf is *always* available in AD and so
> that if doesn't do anything
>
> I think that you will need to check for the attribute being present
> before you use the variable. I've not done a huge amount of Shib2
> scriplet work but I'd try something like:
>
> if (requestContext.getAttributes().containsKey("groupMembership")) {
> bla;
> }
Alternatively, in Javascript it's common to test for the undefined type:
if (typeof groupMembership != "undefined" && groupMembership != null) {
// safe to read groupMembership here
}
Either should work but it might be better to directly test the variable
you are attempting to read.
|