diff --git a/entityreference.module b/entityreference.module
index 352a219..f6a691c 100644
--- a/entityreference.module
+++ b/entityreference.module
@@ -120,7 +120,9 @@ function _entityreference_target_type_validate($element, &$form_state, $form) {
       break;
     }
     $target_type = $entity_type;
-    $target_bundles[] = $bundle;
+    if (!empty($bundle)) {
+      $target_bundles[] = $bundle;
+    }
   }
 
   // When the "all bundles" option is selected, remove all the other bundles.
