Problem/Motivation
Steps to reproduce
1) go to structure->taxonomy-> click list terms of any taxonomy and switch domain
2) This will give fatal error:
TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in array_keys() (line 235 of /mnt/www/html/aamcmicrositesuat/docroot/core/modules/taxonomy/src/Form/OverviewTerms.php)
Proposed resolution
Here in https://git.drupalcode.org/project/drupal/-/blob/9.3.x/core/modules/taxo...
we are checking for $user_input = $form_state->getUserInput(); !empty($user_input) but we also need to check for !empty($user_input['terms']), as some events like domain switcher will be having array values for $user_input but may not be having value for key $user_input['terms'].
This will throw fatal error in https://git.drupalcode.org/project/drupal/-/blob/9.3.x/core/modules/taxo... while executing array functions.