r2.12 cherry-pick: f6db67b1f54 "Fix segmentation fault when running with VLOG level >= 1. Ensure `options.graph` isn't null before dereferencing it."
Refer to the original commit: https://github.com/tensorflow/tensorflow/commit/f6db67b