--- ubercart/uc_cart/uc_cart.module	2012-02-01 22:29:02.000000000 +0200
+++ ubercart/uc_cart/uc_cart.module.new	2012-02-05 10:15:22.000000000 +0200
@@ -1292,8 +1292,8 @@
         $items[$cid] = entity_load('uc_cart_item', array_keys($result['uc_cart_item']), NULL, TRUE);
         // Create a bare order and attach it to each item as context.
         $order = new UcOrder();
-        $order->uid = $cid;
-        if ($account = user_load($cid)) {
+        $order->uid = preg_match ('/^[0-9]+$/', $cid) ? $cid : 0;
+        if ($order->uid && ($account = user_load($cid))) {
           $order->primary_email = $account->mail;
         }
         $order->order_status = uc_order_state_default('in_checkout');
