--- units.admin.inc_ORIG	2009-09-04 19:13:19.000000000 -0400
+++ units.admin.inc	2009-11-03 19:19:30.000000000 -0500
@@ -11,38 +11,54 @@
  */
 function units_admin_settings() {
   $form = array();
-  $description = t('Configure site-wide list of enabled units. Modules that integrate with Units module may use this list.
-  <br/>If nothing is selected in ALL categories, all units will be enabled.'); 
-  $form['description'] = array(
-    '#value' => $description,
-  );
   $units = units_get_units();
-  $categories = array();
-  foreach($units as $id => $unit) {
-    $categories[$unit['category_id']] = $unit['category'];
-  }
-  foreach($categories as $cat_id => $desc) {
-    $form['category_' .$cat_id] = array(
-      '#type' => 'fieldset',
-      '#title' => $desc,
-      '#collapsible' => TRUE,
-      '#collapsed' => TRUE,
+  if (!empty($units)) {
+    $description = t('Configure site-wide list of enabled units. Modules that integrate with Units module may use this list.
+    <br/>If nothing is selected in ALL categories, all units will be enabled.'); 
+    $form['description'] = array(
+      '#value' => $description,
     );
+    $categories = array();
     foreach($units as $id => $unit) {
-      if ($unit['category_id'] == $cat_id) {
-        $form['category_' .$cat_id]['enable_'. $id] = array(
-          '#type' => 'checkbox',
-          '#title' => $unit['fullname'],
-          '#default_value' => in_array($id, units_get_enabled_units()) ? 1 : 0,
-        );
+      $categories[$unit['category_id']] = $unit['category'];
+    }
+    foreach($categories as $cat_id => $desc) {
+      $form['category_' .$cat_id] = array(
+        '#type' => 'fieldset',
+        '#title' => $desc,
+        '#collapsible' => TRUE,
+        '#collapsed' => TRUE,
+      );
+      foreach($units as $id => $unit) {
+        if ($unit['category_id'] == $cat_id) {
+          $form['category_' .$cat_id]['enable_'. $id] = array(
+            '#type' => 'checkbox',
+            '#title' => $unit['fullname'],
+            '#default_value' => in_array($id, units_get_enabled_units()) ? 1 : 0,
+          );
+        }
       }
     }
+    $form['save'] = array(
+      '#type' => 'submit',
+      '#value' => t('Save'),
+      '#submit' => array('units_admin_settings_submit'),
+    );
+  } else {
+    $description = t('Configure site-wide list of enabled units. Modules that integrate with Units module may use this list.
+    <br/>If nothing is selected in ALL categories, all units will be enabled.
+    <br/>
+    <br/>There are currently no installed modules that expose units. The 
+    ' . l('UnitsAPI Module', 'http://drupal.org/project/unitsapi', array('attributes' => array('target' => '_blank'))) . '
+     has many common units.
+    <br/>
+    (Until is it committed, you may need to apply 
+    ' . l('this patch', 'http://drupal.org/node/622622#comment-2223454', array('attributes' => array('target' => '_blank'))) . '
+     to expose the units from UnitsAPI to the Unit module.');
+    $form['description'] = array(
+      '#value' => $description,
+    );
   }
-  $form['save'] = array(
-    '#type' => 'submit',
-    '#value' => t('Save'),
-    '#submit' => array('units_admin_settings_submit'),
-  );
   return $form;
 }
 
