diff --git a/sites/all/modules/contextual/contextual.module b/sites/all/modules/contextual/contextual.module
index 589a0eb..a18eb60 100644
--- a/sites/all/modules/contextual/contextual.module
+++ b/sites/all/modules/contextual/contextual.module
@@ -244,21 +244,21 @@ function contextual_preprocess_views_view(&$vars) {
 
   $links = contextual_get_all_links($vars['view'], 'views');
 
-  // Taxonomy term support.
-  if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
-    if (user_access('administer taxonomy')) {
-      $links['term-edit'] = array(
-        'weight' => 1,
-        'title' => 'Edit term',
-        'href' => 'admin/content/taxonomy/edit/term/'. $term->tid,
-      );
-      contextual_set_links('page-actions', $links['term-edit'], 'term-edit');
+  if (!empty($links)) {
+    // Taxonomy term support.
+    if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
+      if (user_access('administer taxonomy')) {
+        $links['term-edit'] = array(
+          'weight' => 1,
+          'title' => 'Edit term',
+          'href' => 'admin/content/taxonomy/edit/term/'. $term->tid,
+        );
+        contextual_set_links('page-actions', $links['term-edit'], 'term-edit');
+      }
     }
-  }
 
-  $vars['views_classes'] = '';
+    $vars['views_classes'] = '';
 
-  if (!empty($links)) {
     contextual_set_closure($links, 'contextual-view-'. $vars['view']->vid);
     $vars['views_classes'] = 'contextual-enabled';
   }
