diff --git a/voting_rules.module b/voting_rules.module
index 76c6f0b..1b7f300 100644
--- a/voting_rules.module
+++ b/voting_rules.module
@@ -62,6 +62,10 @@ function voting_rules_votingapi_results($cached, $entity_type, $entity_id) {
  *   The entity ID.
  */
 function voting_rules_load_entity($entity_type, $entity_id) {
+  if (empty($entity_type) || is_null($entity_id)) {
+    // Use is_null() for Anonymous user entity.
+    return FALSE;
+  }
   switch ($entity_type) {
     case 'node':
       return node_load($entity_id);
