diff --git a/core/modules/node/src/Controller/NodePreviewController.php b/core/modules/node/src/Controller/NodePreviewController.php
index fab222e..096874e 100644
--- a/core/modules/node/src/Controller/NodePreviewController.php
+++ b/core/modules/node/src/Controller/NodePreviewController.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\Controller\EntityViewController;
+use Symfony\Component\Routing\Exception\InvalidParameterException;
 
 /**
  * Defines a controller to render a single node in preview.
@@ -24,21 +25,28 @@ public function view(EntityInterface $node_preview, $view_mode_id = 'full', $lan
 
     foreach ($node_preview->uriRelationships() as $rel) {
       // Set the node path as the canonical URL to prevent duplicate content.
-      $build['#attached']['html_head_link'][] = array(
-        array(
-        'rel' => $rel,
-        'href' => $node_preview->url($rel),
-        )
-        , TRUE);
-
-      if ($rel == 'canonical') {
-        // Set the non-aliased canonical path as a default shortlink.
+      try {
         $build['#attached']['html_head_link'][] = array(
           array(
-            'rel' => 'shortlink',
-            'href' => $node_preview->url($rel, array('alias' => TRUE)),
-          )
-        , TRUE);
+            'rel' => $rel,
+            'href' => $node_preview->url($rel),
+          ),
+          TRUE,
+        );
+
+        if ($rel == 'canonical') {
+          // Set the non-aliased canonical path as a default shortlink.
+          $build['#attached']['html_head_link'][] = array(
+            array(
+              'rel' => 'shortlink',
+              'href' => $node_preview->url($rel, array('alias' => TRUE)),
+            ),
+            TRUE,
+          );
+        }
+      }
+      catch (InvalidParameterException $e) {
+        continue;
       }
     }
 
