Closes #9636

I see no reason not to have this check. This PR is equivalent to #9636, just changes a little less.