Added extra undefined handling

I was getting a crash. Not sure how to repo the case but this fixed it.