Issue #3532249 by anybody: Uncaught TypeError: toolbarElement.querySelector(...) is null
https://www.drupal.org/project/admin_toolbar/issues/3532249
Check for the existence of elements selected on the page with IDs or classes.
Added if
variable exists statements on selected elements to prevent errors.
Edited by David Suissa