fix rendering of legendicons with 0-length name (#4782)