--- scheduler.module	2013-07-27 18:42:28.000000000 +0100
+++ scheduler.module	2013-09-17 17:08:13.000000000 +0100
@@ -743,9 +743,11 @@ function _scheduler_publish() {
   $date_format = variable_get('scheduler_date_format', SCHEDULER_DATE_FORMAT);
 
   // If the time now is greater than the time to publish a node, publish it.
+  // Use an INNER join 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));
@@ -818,9 +820,11 @@ function _scheduler_unpublish() {
   $date_format = variable_get('scheduler_date_format', SCHEDULER_DATE_FORMAT);
 
   // If the time is greater than the time to unpublish a node, unpublish it.
+  // Use an INNER join 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, '<');
   $queryResult = $query->execute();
