There was just a missing check. Fixes #22193. Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>