I fetching a list of child pages grouped by a content field like so:
$pages = $site->page('some/path')->children()->visible()->sortBy('year')->groupBy('year');
However, if a page has a blank “year” field, it’s throwing a fatal error and breaking the entire page.
Uncaught exception 'Exception' with message 'Invalid grouping value for key: some/path/a_page' in /.../kirby/core/pages.php:285