Fix nil pointer dereference reported by @chuhnk on Twitter.