diff --git a/commerce_civicrm.module b/commerce_civicrm.module
index 08918ed..fa50bb3 100644
--- a/commerce_civicrm.module
+++ b/commerce_civicrm.module
@@ -102,7 +102,7 @@ function commerce_civicrm_civicrm_links($op, $objectName, $objectId) {
     // Get the Drupal uid for the CiviCRM contact if there is a match
     $params = array('contact_id' => $cid, 'version' => 3);
     $uf_match = civicrm_api('uf_match', 'get', $params);
-    if ($uf_match['id'] && count($uf_match['values'] == 1)) {
+    if (!empty($uf_match['id']) && count($uf_match['values'] == 1)) {
       $uid = $uf_match['id'];
     }
     switch ($objectName) {
