WL-2499 added null check to avoid NPE when providing no roles.