Add assertions to dk_set_index()

Issue #27350.
1 file changed