Dimensions: Reverse a check to avoid potential reflows

Fixes #14979
Closes gh-1560