diff --git a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
index 6da6940..97cfa7e 100644
--- a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
+++ b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\Component\Plugin\Discovery;
 
+use Drupal\Component\Plugin\Exception\PluginException;
+
 /**
  * Base class providing the tools for a plugin discovery to be derivative aware.
  *
@@ -134,13 +136,13 @@ protected function encodePluginId($base_plugin_id, $derivative_id) {
    *   The base plugin definition to build derivatives.
    *
    * @return Drupal\Component\Plugin\Discovery\DerivativeInterface|null
-   *   A DerivativeInterface or null if none exists for the plugin.
+   *   A DerivativeInterface or NULL if none exists for the plugin.
    */
   protected function getDerivativeFetcher($base_plugin_id, array $base_definition) {
     if (!isset($this->derivativeFetchers[$base_plugin_id])) {
       $this->derivativeFetchers[$base_plugin_id] = FALSE;
-      if (isset($base_definition['derivative'])) {
-        $class = $base_definition['derivative'];
+      $class = $this->getDerivativeClass($base_definition);
+      if ($class) {
         $this->derivativeFetchers[$base_plugin_id] = new $class($base_plugin_id);
       }
     }
@@ -148,6 +150,27 @@ protected function getDerivativeFetcher($base_plugin_id, array $base_definition)
   }
 
   /**
+   * Get the derivative class name from the base plugin definition.
+   *
+   * @return string|NULL
+   *   The name of a class implementing \Drupal\Component\Plugin\Derivative\DerivativeInterface.
+   *
+   * @throws Drupal\Component\Plugin\Exception\PluginException
+   *   Thrown if the class in the definition does not implement the expected
+   *   interface.
+   */
+  protected function getDerivativeClass($base_definition) {
+    $class = NULL;
+    if (isset($base_definition['derivative'])) {
+      $class = $base_definition['derivative'];
+      if (!is_subclass_of($class, '\Drupal\Component\Plugin\Derivative\DerivativeInterface')) {
+        throw new PluginException(sprintf('Plugin (%s) derivative class "%s" has to implement interface \Drupal\Component\Plugin\Derivative\DerivativeInterface', $base_plugin_id, $class));
+      }
+    }
+    return $class;
+  }
+
+  /**
    * Passes through all unknown calls onto the decorated object.
    */
   public function __call($method, $args) {
diff --git a/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php b/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php
index fcae2e3..eed640c 100644
--- a/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php
+++ b/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php
@@ -17,8 +17,8 @@ class ContainerDerivativeDiscoveryDecorator extends DerivativeDiscoveryDecorator
   protected function getDerivativeFetcher($base_plugin_id, array $base_definition) {
     if (!isset($this->derivativeFetchers[$base_plugin_id])) {
       $this->derivativeFetchers[$base_plugin_id] = FALSE;
-      if (isset($base_definition['derivative'])) {
-        $class = $base_definition['derivative'];
+      $class = $this->getDerivativeClass($base_definition);
+      if ($class) {
         // If the derivative class provides a factory method, pass the container
         // to it.
         if (is_subclass_of($class, 'Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface')) {
