It would be safer to use the isLecturer(CourseComponentDAO, UserProxy, boolean) which has null checks.