IMO this check should be done outside the layout