Fix for Updating user_force_term from D5 to D6

  1. /*
  2.   hook_user() gets called without a valid account.
  3.  
  4.   Merlinofchaos suggested an empty() check but a quick test revealed that more was needed in this case.
  5.  
  6.   A simple empty($account) failed since empty() returns false on a variable containing an empty stdClass Object. Another check was needed resulting in this:
  7.  
  8.     if (empty($account) || !isset($account->uid)) { return; }
  9.  
  10.   The fixed code:
  11. */
  12.  
  13. /**
  14.  * Implementation of hook_user().
  15.  */
  16. function user_force_term_user($op, &$edit, &$account, $category = NULL) {
  17.   if (empty($account) || !isset($account->uid)) { return; }
  18.   $uid = $account->uid;        
  19.  
  20. // ...
  21.  
  22. }