fix #6218: avoid NPE when remove text from label field