Prevent NPE in buggy situation where field to index doesn't have a database equivalent.
(cherry picked from commit 6398bae)