--- uc_ajax_cart.module.orig	2009-02-20 12:36:35.000000000 +0100
+++ uc_ajax_cart.module	2009-03-19 22:11:14.000000000 +0100
@@ -480,22 +480,24 @@
 
 function uc_attribute_add_to_cart($nid, $qty, $data)
 {
-	$atts = uc_product_get_attributes($nid);
-	$attsSubmitted = $data['attributes'] ;
-	foreach ( $atts as $key => $att )
-	{
-		if ( !$att->required )
-		{
-			continue ;
-		}
-		if ( !isset( $data['attributes'][$att->aid] ) || empty($data['attributes'][$att->aid]) )
-		{
-			return array(array(
-				'success' => false,
-				'message' => t('Please choose a option')
-			));
-		}
-	}
+  if (isset($data['attributes'])) {
+    $atts = uc_product_get_attributes($nid);
+    $attsSubmitted = $data['attributes'] ;
+    foreach ( $atts as $key => $att )
+    {
+      if ( !$att->required )
+      {
+        continue ;
+      }
+      if ( !isset( $data['attributes'][$att->aid] ) || empty($data['attributes'][$att->aid]) )
+      {
+        return array(array(
+          'success' => false,
+          'message' => t('Please choose a option')
+        ));
+      }
+    }
+  }
 }
 
 function uc_stock_add_to_cart($nid, $qty, $data)
