Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-18440 email_to_user() - avoid some notices

  • Loading branch information...
commit 73078aefd51814e88e631e662cca17bfe2303820 1 parent c5129f5
stronk7 authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/moodlelib.php
10 lib/moodlelib.php
View
@@ -2298,6 +2298,11 @@ function over_bounce_threshold($user) {
if (empty($CFG->handlebounces)) {
return false;
}
+
+ if (empty($user->id)) { /// No real (DB) user, nothing to do here.
+ return false;
+ }
+
// set sensible defaults
if (empty($CFG->minbounces)) {
$CFG->minbounces = 10;
@@ -2321,6 +2326,11 @@ function over_bounce_threshold($user) {
* @param $reset - will reset the count to 0
*/
function set_send_count($user,$reset=false) {
+
+ if (empty($user->id)) { /// No real (DB) user, nothing to do here.
+ return;
+ }
+
if ($pref = get_record('user_preferences','userid',$user->id,'name','email_send_count')) {
$pref->value = (!empty($reset)) ? 0 : $pref->value+1;
update_record('user_preferences',$pref);
Please sign in to comment.
Something went wrong with that request. Please try again.