Index: workflow.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/workflow/workflow.module,v
retrieving revision 1.83
diff -u -r1.83 workflow.module
--- workflow.module	1 Jan 2009 21:09:16 -0000	1.83
+++ workflow.module	5 Jun 2009 21:43:33 -0000
@@ -455,8 +455,11 @@
       );
     }
 
+    $timestamp = NULL;
+    $comment = '';
+
     // See if scheduling information is present.
-    if ($node->_workflow_scheduled_timestamp && $node->_workflow_scheduled_sid) {
+    if (isset($node->_workflow_scheduled_timestamp) && isset($node->_workflow_scheduled_sid)) {
       // The default value should be the upcoming sid.
       $current = $node->_workflow_scheduled_sid;
       $timestamp = $node->_workflow_scheduled_timestamp;
@@ -467,7 +470,7 @@
       $comment = $form_state['values']['workflow_comment'];
     }
 
-    workflow_node_form($form, $form_state, $name, $name, $current, $choices, $timestamp, $comment);
+    workflow_node_form($form, $form_state, '', '', $current, $choices, $timestamp, $comment);
   }
 }
 
@@ -708,9 +711,13 @@
  *   The ID of the current state.
  */
 function workflow_node_current_state($node) {
-  $sid = db_result(db_query('SELECT sid FROM {workflow_node} WHERE nid = %d', $node->nid));
+  $sid = FALSE;
+
+  if (!empty($node->nid)) {
+    $sid = db_result(db_query('SELECT sid FROM {workflow_node} WHERE nid = %d', $node->nid));
+  }
 
-  if (!$sid) {
+  if (!$sid && !empty($node->type)) {
     // No current state. Use creation state.
     $wid = workflow_get_workflow_for_type($node->type);
     $sid = _workflow_creation_state($wid);
