Fixed nullPointerException thrown when AttributeDescriptor is null

Ran into this while testing an unrelated project (gt-property-ng), clearly a bug since the check `ad == null` can never return true because of the `ad.getType()` call on the previous line.