fix #5971 fix NPE for not existing preference