diff --git a/lib/Drupal/views/Tests/WizardJumpMenuTest.php b/lib/Drupal/views/Tests/WizardJumpMenuTest.php
index 897cc7ea5fad07cd709940409cbf58bce92f0773..d1d6a30fe59cfaf7f9f2a3c2e3d5c3746268f527 100644
--- a/lib/Drupal/views/Tests/WizardJumpMenuTest.php
+++ b/lib/Drupal/views/Tests/WizardJumpMenuTest.php
@@ -70,6 +70,10 @@ function testJumpMenus() {
       // The urls are built with :: to be able to have a unique path all the time,
       // so try to find out the real path of $edit.
       $view_object = views_get_view($view['name']);
+      if (!$view_object) {
+        $this->fail('The view could not be loaded.');
+        return;
+      }
       $view_object->preview('page');
       $form = $view_object->style_plugin->render();
       $jump_options = $form['jump']['#options'];
@@ -169,4 +173,3 @@ function createNodeRevisionAndGetPath() {
     return 'node/' . $node->nid . '/revisions/' . $node->vid . '/view';
   }
 }
-