Basic sanity check to avoid segfaults for a common failure mode