diff --git web/sites/all/modules/contrib/flag_friend/flag_friend.install web/sites/all/modules/contrib/flag_friend/flag_friend.install
index 41f9ceb..4579d37 100644
--- web/sites/all/modules/contrib/flag_friend/flag_friend.install
+++ web/sites/all/modules/contrib/flag_friend/flag_friend.install
@@ -92,3 +92,21 @@ function flag_friend_update_7000() {
   db_query("DELETE ff FROM {flag_friend} ff LEFT JOIN {users} u1 ON u1.uid = ff.uid LEFT JOIN {users} u2 ON u2.uid = ff.friend_uid WHERE u1.uid IS NULL OR u2.uid IS NULL");
 }
 
+/**
+ * Delete duplicate flag_friend data.
+ */
+function flag_friend_update_7001() {
+  $flag_friends = db_query("SELECT CONCAT(ff.uid, '__', ff.friend_uid) AS id1, CONCAT(ff1.uid, '__', ff1.friend_uid) AS id2 FROM {flag_friend} ff LEFT JOIN {flag_friend} ff1 ON ff1.uid = ff.friend_uid AND ff1.friend_uid = ff.uid WHERE ff1.uid IS NOT NULL")->fetchAllKeyed();
+
+  foreach ($flag_friends as $id1 => $id2) {
+    if (isset($flag_friends[$id2]) && $flag_friends[$id2] == $id1) {
+      unset($flag_friends[$id1]);
+    }
+  }
+
+  foreach ($flag_friends as $id) {
+    list($uid, $friend_uid) = explode('__', $id);
+    db_query("DELETE ff FROM {flag_friend} ff WHERE ff.uid = :uid AND ff.friend_uid = :friend_uid", array(':uid' => $uid, ':friend_uid' => $friend_uid));
+  }
+}
+
diff --git web/sites/all/modules/contrib/flag_friend/flag_friend.module web/sites/all/modules/contrib/flag_friend/flag_friend.module
index 06407c0..4cac02c 100644
--- web/sites/all/modules/contrib/flag_friend/flag_friend.module
+++ web/sites/all/modules/contrib/flag_friend/flag_friend.module
@@ -25,14 +25,17 @@ function flag_friend_flag($event, $flag, $content_id, $account) {
 
       // If both are now flagged, we record the relationship and remove the flags.
       if ($status === FLAG_FRIEND_BOTH) {
-        $id = db_insert('flag_friend')
-          ->fields(array(
-            'uid' => $account->uid,
-            'friend_uid' => $content_id,
-            'created' => $_SERVER['REQUEST_TIME'],
-          ))
-          ->execute();
-        NULL;
+        // Ensure no duplicates are made.
+        $exists = db_query("SELECT COUNT(1) FROM {flag_friend} WHERE (uid = :uid AND friend_uid = :friend_uid) OR (uid = :friend_uid AND friend_uid = :uid)", array(':uid' => $account->uid, ':friend_uid' => $content_id))->fetchField();
+        if (!$exists) {
+          $id = db_insert('flag_friend')
+            ->fields(array(
+              'uid' => $account->uid,
+              'friend_uid' => $content_id,
+              'created' => $_SERVER['REQUEST_TIME'],
+            ))
+            ->execute();
+        }
 
         // Remove any message entries for either user.
         flag_friend_message('unflag', $flag, $account->uid, $content_id);

