[minor] factory out into a "copyOfOrEmpty" or similar method. If not, add a space in `if(...`?