Fix nil pointer dereference.

Ran into by @toddfries and brought up on IRC.