Check for null context along with null context id.

Found while reproducing [69993594](https://www.pivotaltracker.com/story/show/69993594).  Doesn't reproduce after inserting context check here.