Fix NPE when no attributes available to be encoded into a name identifier