Is a chassis check worth it on a car still under warranty?

Buying a used car that’s only two years old and still has the manufacturer warranty left, so my thinking was that the dealer history and warranty should cover any concerns. A friend said I should still do a chassis number check regardless of age. Part of me thinks that’s overkill for something nearly new but the other part remembers that accidents happen to new cars too. Is it actually worth the effort in this situation or am I just adding stress to an already stressful process? I want to see the details before I decide either way, but I’m curious what others would do. Would you skip the check on a nearly new car or is that exactly when you shouldn’t?