先判断下no不为空试试。var no = funcs_zTree.getNodeByParam("id", arr[i]);if (node != null) { funcs_zTree.checkNode(no, true); }