Problem/Motivation
Error was introduced in the 10.3.6 release of Drupal.
Fatal error: Uncaught TypeError: Drupal\Core\Extension\ThemeHandler::addTheme(): Argument #1 ($theme) must be of type Drupal\Core\Extension\Extension, null given, called in /var/www/html/core/lib/Drupal/Core/Extension/ThemeHandler.php on line 74 and defined in /var/www/html/core/lib/Drupal/Core/Extension/ThemeHandler.php:84
Steps to reproduce
Install a previous version of Drupal e.g. if the current version is 11.x install 10.x.
Choose a theme e.g. a core theme that is present in the 10.x codebase but not in the 11.x.
Or Install a contrib theme in 10.x.
Enable and then save the theme.
The theme's installed and enabled states will be stored in the core.extension.yml configuration file.
Update Drupal to the latest version ie in the example above, to 11.x.
Remove the theme from the 11.x codebase.
Run drush updb
This should result in a WSOD with the message above.
Proposed resolution
Partial revert of the logic change in #3457863: YAML discovery does not take theme inheritance into account so that ThemeHandler::listInfo() does not error if theme extension info is missing.
Remaining tasks
User interface changes
None
Introduced terminology
N/a
API changes
None
Data model changes
None
Release notes snippet
N/a