Index: domain.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v
retrieving revision 1.88
diff -u -r1.88 domain.module
--- domain.module	4 Jan 2009 16:41:23 -0000	1.88
+++ domain.module	9 Jan 2009 17:59:36 -0000
@@ -65,6 +65,7 @@
   // End of the error handling routine.
 
   // Strip the www. off the domain, if required by the module settings.
+  $www_replaced = FALSE;
   if (variable_get('domain_www', 0) && strpos($_domain['subdomain'], 'www.') !== FALSE) {
     $_domain['subdomain'] = str_replace('www.', '', $_domain['subdomain']);
     $www_replaced = TRUE;
@@ -614,6 +615,10 @@
  */
 function domain_get_user_domains($account, $add_roles = TRUE, $reset = FALSE) {
   static $domains = array();
+  if (! $account) {
+    // This may happen when creating a new user.
+    return array();
+  }
   $uid = (int) $account->uid;
   if (!isset($domains[$uid]) || $reset) {
     $domains[$uid] = array();
