This shouldn't happen often in the wild, but if a user has just used a report, and then the module that provides the report is uninstalled, the user gets a WSOD the next time they visit the reports page. We should check for the service that provides the report's data. This cod should do it:
if (!empty(\Drupal::hasService('serviceID'))) {
$foo = \Drupal::service('serviceID');
}
else {
// Tell user the report they requested is not available.
}
This shouldn't happen often in the wild, but if a user has just used a report, and then the module that provides the report is uninstalled, the user gets a WSOD the next time they visit the reports page. We should check for the service that provides the report's data. This cod should do it: