fixed NullPointerException makeGetPreferenceCourse

tell me if this is correct