--- uc_reorder.module	2009-05-09 01:17:47.000000000 -0300
+++ uc_reorder.module.new	2009-12-06 11:01:05.000000000 -0300
@@ -97,16 +97,18 @@
 
     // Loop over all string attributes to find corresponding numerical
     // attribute so we can rebuild attributes sub-array
-    foreach ($str_attributes as $attribute => $option) {
-      $attr_result = db_fetch_object(db_query("SELECT * FROM {uc_attributes} WHERE name = '%s'", $attribute));
-      $opt_result = db_fetch_object(db_query("SELECT * FROM {uc_attribute_options} WHERE aid = %d AND name = '%s'", $attr_result->aid, $option));
-      if ($opt_result->oid) {
-        $product->data['attributes'][$attr_result->aid] = $opt_result->oid;
+    if (isset($str_attribues)) {
+      foreach ($str_attributes as $attribute => $option) {
+        $attr_result = db_fetch_object(db_query("SELECT * FROM {uc_attributes} WHERE name = '%s'", $attribute));
+        $opt_result = db_fetch_object(db_query("SELECT * FROM {uc_attribute_options} WHERE aid = %d AND name = '%s'", $attr_result->aid, $option));
+        if ($opt_result->oid) {
+          $product->data['attributes'][$attr_result->aid] = $opt_result->oid;
+        }
+        else {  // Text field attribute
+          $product->data['attributes'][$attr_result->aid] = check_plain($option);
+        }
       }
-      else {  // Text field attribute
-        $product->data['attributes'][$attr_result->aid] = check_plain($option);
-      }
-    }
+    } 
 
     uc_cart_add_item($product->nid, $product->qty, $product->data, $uid, TRUE, FALSE);
   }
