diff --git a/user_relationship_invites/user_relationship_invites.module b/user_relationship_invites/user_relationship_invites.module
index 7012edd..aa2d86c 100644
--- a/user_relationship_invites/user_relationship_invites.module
+++ b/user_relationship_invites/user_relationship_invites.module
@@ -78,7 +78,8 @@ function user_relationship_invites_user($op, &$edit, &$account, $category = NULL
 
   switch ($op) {
     case 'register':
-      if (($code = $_SESSION[INVITE_SESSION]) && ($invite = user_relationship_invites_get_invite($code)) && $invite->relationship_type) {
+      if (!empty($_SESSION[INVITE_SESSION]) &&
+          ($code = $_SESSION[INVITE_SESSION]) && ($invite = user_relationship_invites_get_invite($code)) && $invite->relationship_type) {
         $form = array();
         $inviter = $invite->inviter;
         $relationship_type = $invite->relationship_type;
