--- modules/node/node.module	2011-01-15 17:37:29.647245908 +0300
+++ modules/node/node.module	2011-01-15 17:40:27.559673251 +0300
@@ -1006,13 +1006,14 @@ function node_submit($node) {
 
   // A user might assign the node author by entering a user name in the node
   // form, which we then need to translate to a user ID.
-  if (isset($node->name)) {
-    if ($account = user_load_by_name($node->name)) {
+  $name = isset($node->name) ? $node->name : $user->name;
+  if (isset($name)) {
+    if ($account = user_load_by_name($name)) {
       $node->uid = $account->uid;
     }
-    else {
-      $node->uid = 0;
-    }
+  }
+  else {
+    $node->uid = 0;
   }
 
   $node->created = !empty($node->date) ? strtotime($node->date) : REQUEST_TIME;
