TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given
Problem/Motivation
When running devel_generate on a clean install of Drupal Core the process can result in the nodes and the home page breaking with the following error:
The website encountered an unexpected error. Try again later.
TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/web/core/lib/Drupal/Core/Utility/LinkGenerator.php on line 198 in Drupal\Component\Utility\Html::escape() (line 431 of core/lib/Drupal/Component/Utility/Html.php).
Steps to replicate:
ddev drush -y site:install --account-name=admin --account-pass=admin
ddev drush en -y devel_generate
ddev drush devel-generate:content --bundles=article 10
I thought it was due to some of the nodes being created with the Anonymous user as the author, but I tested with --author=1 set and the same issue occurs.
It also looks like some comments get created without either the Hidden or Open being set, but again I have checked and some of the nodes with this set correctly also experience this problem.
So it seems that these are not the only thing missing set with some problem data.
Saving the nodes once more seems to solve the problem.
Proposed resolution
Identify the missing information and make sure when devel_generate creates the nodes it adds the correct data to the node.