make select() and selectBranch() null-safe