diff --git a/download_file.module b/download_file.module
index b8c202b..cca389b 100644
--- a/download_file.module
+++ b/download_file.module
@@ -218,34 +218,36 @@ function download_file_field_formatter_info() {
 function download_file_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
   $element = array();

-  switch ($display['type']) {
-    case 'direct_download':
-      $element[0] = array(
-        '#theme' => 'download_file_formatter_direct_download',
-        '#items' => $items
-      );
-      break;
-
-    case 'direct_download_icon':
-      $element[0] = array(
-        '#theme' => 'download_file_formatter_direct_download_icon',
-        '#items' => $items
-      );
-      break;
-
-    case 'direct_download_accessible':
-      $element[0] = array(
-        '#theme' => 'download_file_formatter_direct_download_accessible',
-        '#items' => $items
-      );
-      break;
-
-    case 'direct_download_accessible_icon':
-      $element[0] = array(
-        '#theme' => 'download_file_formatter_direct_download_accessible_icon',
-        '#items' => $items
-      );
-      break;
+  if ($items) {
+    switch ($display['type']) {
+      case 'direct_download':
+        $element[0] = array(
+          '#theme' => 'download_file_formatter_direct_download',
+          '#items' => $items
+        );
+        break;
+
+      case 'direct_download_icon':
+        $element[0] = array(
+          '#theme' => 'download_file_formatter_direct_download_icon',
+          '#items' => $items
+        );
+        break;
+
+      case 'direct_download_accessible':
+        $element[0] = array(
+          '#theme' => 'download_file_formatter_direct_download_accessible',
+          '#items' => $items
+        );
+        break;
+
+      case 'direct_download_accessible_icon':
+        $element[0] = array(
+          '#theme' => 'download_file_formatter_direct_download_accessible_icon',
+          '#items' => $items
+        );
+        break;
+    }
   }

   return $element;
