diff --git a/includes/quicktabs_style_plugin.inc b/includes/quicktabs_style_plugin.inc
index 1a9e1c0..226e391 100644
--- a/includes/quicktabs_style_plugin.inc
+++ b/includes/quicktabs_style_plugin.inc
@@ -15,6 +15,7 @@ class quicktabs_style_plugin extends views_plugin_style {
     $options = parent::option_definition();
     $options['tab_style'] = array('default' => 'default');
     $options['tab_title_field'] = array('default' => NULL);
+    $options['tab_hide_empty_tabs'] = array('default' => 0);
 
     return $options;
   }
@@ -57,6 +58,13 @@ class quicktabs_style_plugin extends views_plugin_style {
         '#description' => t('Select the field that will be used as the tab title.'),
         '#weight' => -3,
       );
+      $form['tab_hide_empty_tabs'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Hide empty tabs'),
+        '#default_value' => isset($this->options['tab_hide_empty_tabs']) ? $this->options['tab_hide_empty_tabs'] : 0,
+        '#description' => t('Empty and restricted tabs will not be displayed. Could be useful when the tab content is not accessible.<br />This option does not work in ajax mode.'),
+        '#weight' => -1,
+      );
     }
   }
 
@@ -136,7 +144,11 @@ class quicktabs_style_plugin extends views_plugin_style {
       }
     }
 
-    $overrides = array('style' => $view->style_options['tab_style'], 'sorted' => TRUE);
+    $overrides = array(
+      'style' => $view->style_options['tab_style'],
+      'sorted' => TRUE,
+      'hide_empty_tabs' => $view->style_options['tab_hide_empty_tabs'],
+    );
     $quicktabs = quicktabs_build_quicktabs($qt_name, $overrides, $tabs);
 
     $output = drupal_render($quicktabs);
diff --git a/quicktabs.classes.inc b/quicktabs.classes.inc
index 6dfe148..ce686d0 100644
--- a/quicktabs.classes.inc
+++ b/quicktabs.classes.inc
@@ -467,7 +467,7 @@ class QuickPreRenderedContent implements QuickContentRenderable {
    */
   public function __construct($item) {
 
-    $contents = isset($item['contents']) ? $item['contents'] : array();
+    $contents = (isset($item['contents']) && isset($item['contents']['#markup']) && !empty($item['contents']['#markup'])) ? $item['contents'] : array();
     if (!is_array($contents)) {
       $contents = array('#markup' => $contents);
     }
@@ -513,4 +513,4 @@ class QuickPreRenderedContent implements QuickContentRenderable {
  */
 class InvalidQuickSetException extends Exception {
   
-}
\ No newline at end of file
+}
