Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 21827)
+++ wp-includes/post.php	(working copy)
@@ -2811,18 +2811,17 @@
 		$postarr = add_magic_quotes($postarr);
 	}
 
-	// First, get all of the original fields
-	$post = get_post($postarr['ID'], ARRAY_A);
+	$post = array();
+	if ( ! empty( $postarr['ID'] ) ) {
+		// First, get all of the original fields
+		$post = get_post($postarr['ID'], ARRAY_A);
 
-	// Escape data pulled from DB.
-	$post = add_magic_quotes($post);
+		// Escape data pulled from DB.
+		$post = add_magic_quotes($post);		
+	}
 
 	// Passed post category list overwrites existing category list if not empty.
-	if ( isset($postarr['post_category']) && is_array($postarr['post_category'])
-			 && 0 != count($postarr['post_category']) )
-		$post_cats = $postarr['post_category'];
-	else
-		$post_cats = $post['post_category'];
+	$post_cats = empty( $post['post_category'] ) ? array() : (array) $post['post_category'];
 
 	// Drafts shouldn't be assigned a date unless explicitly done so by the user
 	if ( isset( $post['post_status'] ) && in_array($post['post_status'], array('draft', 'pending', 'auto-draft')) && empty($postarr['edit_date']) &&
