diff --git a/scheduler.module b/scheduler.module
index f58f201..8e396d4 100644
--- a/scheduler.module
+++ b/scheduler.module
@@ -756,10 +756,11 @@ function _scheduler_publish() {
 
   // If the time now is greater than the time to publish a node, publish it.
+  // The INNER join on 'node' and 'users' is just to ensure the nodes are valid.
   $query = db_select('scheduler', 's');
   $query->addField('s', 'nid');
-  $query->addJoin('LEFT ', 'node', 'n', 's.nid = n.nid');
+  $query->addJoin('INNER', 'node', 'n', 's.nid = n.nid');
+  $query->addJoin('INNER', 'users', 'u', 'u.uid = n.uid');
   $query->condition('s.publish_on', 0, '>');
   $query->condition('s.publish_on', REQUEST_TIME, '<');
-  //  $query_result = db_query('SELECT s.nid AS nid FROM {scheduler} s LEFT JOIN {node} n ON s.nid = n.nid WHERE n.status = 0 AND s.publish_on > 0 AND s.publish_on < :now ', array(':now' => REQUEST_TIME));
   $queryResult = $query->execute();
   $nids = array();
@@ -831,7 +832,9 @@ function _scheduler_unpublish() {
 
   // If the time is greater than the time to unpublish a node, unpublish it.
+  // The INNER join on 'node' and 'users' is just to ensure the nodes are valid.
   $query = db_select('scheduler', 's');
   $query->addField('s', 'nid');
-  $query->addJoin('LEFT', 'node', 'n', 's.nid = n.nid');
+  $query->addJoin('INNER', 'node', 'n', 's.nid = n.nid');
+  $query->addJoin('INNER', 'users', 'u', 'u.uid = n.uid');
   $query->condition('s.unpublish_on', 0, '>');
   $query->condition('s.unpublish_on', REQUEST_TIME, '<');
