fix #7371: fix NPE when deleting polytomous key