From 74b9b47f9276ba72b062604a42ee37327092162f Mon Sep 17 00:00:00 2001
From: Sascha Grossenbacher <saschagros@gmail.com>
Date: Sun, 20 Mar 2011 17:52:21 +0100
Subject: [PATCH] Issue #1092754 by Berdir: Fixed E_NOTICE when calling userpoints API without points or uid.

---
 userpoints.module |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/userpoints.module b/userpoints.module
index 3a547f4..a39b468 100644
--- a/userpoints.module
+++ b/userpoints.module
@@ -547,11 +547,10 @@ function userpoints_userpointsapi($params) {
     }
 
     // Anonymous users do not get points, and there have to be points to process.
-    if (($params['uid'] == 0 || $params['points'] == 0)) {
+    if (empty($params['uid']) || empty($params['points'])) {
       return array(
           'status' => FALSE,
-          'reason' => 'uid or points = 0. Anonymous users do not get points
-                     and there must be points to process.',
+          'reason' => 'uid or points not given. Anonymous users do not get points and there must be points to process.',
       );
     }
   }
-- 
1.7.4.1

