I have a list which i have initialised. i get a null pointer exception when i try to add to it. does anyone know why. here is a snippet of the problem-causing code.
Employee e=employeeskills.get(0).getEmployee();
List<EmployeeSkills> es;
es=e.getEmployeeskills();
for(int i=0; i<employeeskills.size();i++)
{
es.add(employeeskills.get(i));
}
session.getCurrentSession().saveOrUpdate(e);
employeeskills is an list of objects(EmployeeSkills). EmployeeSkills is the a type of Object.