diff --git a/drupal/sites/all/modules/workflow/workflow.module b/drupal/sites/all/modules/workflow/workflow.module
index 8a11f9d..75ee292 100644
--- a/drupal/sites/all/modules/workflow/workflow.module
+++ b/drupal/sites/all/modules/workflow/workflow.module
@@ -812,9 +812,8 @@ function workflow_node_previous_state($node) {
   // There is no nid when creating a node.
   if (!empty($node->nid)) {
     $sids = array();
-    $sid = -1;
     $last_history = workflow_get_workflow_node_history_by_nid($node->nid, 1);
-    $sid = $last_history->sid;
+    $sid = !$last_history ? FALSE : $last_history->sid;
   }
   if (!$sid && !empty($node->type)) {
     // No current state. Use creation state.
