Fixed a segfault regression in the master.

Review: https://reviews.apache.org/r/25810