diff --git a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
index e245874..8670dd9 100644
--- a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
+++ b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
@@ -67,10 +67,11 @@ class DerivativeDiscoveryDecorator implements DiscoveryInterface {
     foreach ($base_plugin_definitions as $base_plugin_id => $plugin_definition) {
       $derivative_fetcher = $this->getDerivativeFetcher($base_plugin_id, $plugin_definition);
       if ($derivative_fetcher) {
-        $derivative_definitions = $derivative_fetcher->getDerivativeDefinitions($plugin_definition);
-        foreach ($derivative_definitions as $derivative_id => $derivative_definition) {
-          $plugin_id = $this->encodePluginId($base_plugin_id, $derivative_id);
-          $plugin_definitions[$plugin_id] = $derivative_definition;
+        if ($derivative_definitions = $derivative_fetcher->getDerivativeDefinitions($plugin_definition)) {
+          foreach ($derivative_definitions as $derivative_id => $derivative_definition) {
+            $plugin_id = $this->encodePluginId($base_plugin_id, $derivative_id);
+            $plugin_definitions[$plugin_id] = $derivative_definition;
+          }
         }
       }
       else {
