diff --git a/custom_search.module b/custom_search.module
index 35da17e..efd5b76 100644
--- a/custom_search.module
+++ b/custom_search.module
@@ -197,7 +197,9 @@ function custom_search_form_alter(&$form, &$form_state, $form_id) {
           $names = node_type_get_names();
           if (count($types) > 1 || variable_get('custom_search_' . $delta . 'any_force', FALSE)) $toptions['c-all'] = variable_get('custom_search_' . $delta . 'type_selector_all', CUSTOM_SEARCH_ALL_TEXT_DEFAULT);
           foreach ($types as $type) {
-            $toptions['c-' . $type] = $names[$type];
+            if (isset($names[$type])) {
+              $toptions['c-' . $type] = $names[$type];
+            }
           }
         }
         $options = array();
