From c14366a9b5722cd2f0e16ebce2705c6dc3ff3672 Mon Sep 17 00:00:00 2001
From: Demenchuk Dmitry <ded@pisem.net>
Date: Thu, 26 Jan 2012 06:13:54 +0700
Subject: [PATCH] fix warning after undo vote

---
 plus1.module |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plus1.module b/plus1.module
index 5b97215..27beb1e 100644
--- a/plus1.module
+++ b/plus1.module
@@ -199,7 +199,7 @@ function plus1_undo_vote($entity_type, $entity_id, $tag = 'plus1_node_vote') {
       'tag' => $tag ? $tag : 'plus1_' . $entity_type . '_vote',
     );
     $results = votingapi_select_results($criteria);
-    $score = $results[0]['value'] ? $results[0]['value'] : 0;
+    $score = isset($results[0]['value']) ? $results[0]['value'] : 0;
     module_invoke_all('plus1_voted', 'undo_vote', $entity_type, $entity_id, $tag, $score, $user);
     if (isset($_GET['json'])) {
       drupal_json_output(theme('plus1_json_response__' . $entity_type . '__' . $tag, array('entity_type' => $entity_type, 'entity_id' => $entity_id, 'tag' => $tag, 'score' => $score, 'vote_type' => 'undo_vote')));
-- 
1.7.5.4

