fix #19642 crash on opening the preferences dialog