Avoid NullPointerExceptio. When the user is not a teacher lookup the department via the employees working place.