Should this check e.nextElement() is not null first? Seems that's more likely than toString() returning null, but I guess it could happen.