diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module index 946b2d1..625beab 100644 --- a/core/modules/entity/entity.module +++ b/core/modules/entity/entity.module @@ -164,11 +164,13 @@ function entity_module_preuninstall($module) { * Implements hook_modules_uninstalled(). */ function entity_modules_uninstalled($modules) { - $schema = \Drupal::database()->schema(); - foreach ($GLOBALS['entity_schema_uninstall']['tables'] as $table_name) { - if ($schema->tableExists($table_name)) { - $schema->dropTable($table_name); + if (!empty($GLOBALS['entity_schema_uninstall'])) { + $schema = \Drupal::database()->schema(); + foreach ($GLOBALS['entity_schema_uninstall']['tables'] as $table_name) { + if ($schema->tableExists($table_name)) { + $schema->dropTable($table_name); + } } + \Drupal::moduleHandler()->invokeAll('entity_schema_uninstalled', array($GLOBALS['entity_schema_uninstall']['storages'])); } - \Drupal::moduleHandler()->invokeAll('entity_schema_uninstalled', array($GLOBALS['entity_schema_uninstall']['storages'])); }