Index: modules/nmoderation/nmoderation.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/nmoderation/nmoderation.module,v
retrieving revision 1.30
diff -u -r1.30 nmoderation.module
--- modules/nmoderation/nmoderation.module	20 Jun 2006 20:40:30 -0000	1.30
+++ modules/nmoderation/nmoderation.module	16 Feb 2007 18:57:34 -0000
@@ -508,7 +508,7 @@
   global $user;
   if ($form_values['confirm']) {
     $sql = 'SELECT * FROM {votingapi_vote} WHERE vote_id = %d';
-    $vote = db_fetch_object(db_query($sql, $vote_id));
+    $vote = db_fetch_object(db_query($sql, $form_values['vote_id']));
 
     if ($user->uid == $vote->uid || user_access('administer node moderation votes')) {
       votingapi_delete_vote($vote);
@@ -530,12 +530,12 @@
   $result = votingapi_get_voting_result($content_type, $content_id, NMODERATION_CACHE_TYPE, NMODERATION_TAG, 'sum');
   $node = node_load($content_id);
   // have to load terms in order that they don't get lost upon saving the node.
-
-  if ($result->value < variable_get('nmoderation_threshold_unpublish', 4)) {
+  $value = isset($result) ? $result->value : 0;
+  if ($value < variable_get('nmoderation_threshold_unpublish', 4)) {
     $node->status = 0;
     node_save($node);
   }
-  elseif ($result->value > variable_get('nmoderation_threshold_promote', 4)) {
+  elseif ($value > variable_get('nmoderation_threshold_promote', 4)) {
     $node->promote = 1;
     node_save($node);
   }
