Merge branch 'MDL-34118' of git://github.com/timhunt/moodle
[moodle.git] / backup / moodle2 / backup_stepslib.php
index f9dbba0..b4399f2 100644 (file)
@@ -1844,7 +1844,7 @@ class backup_annotate_all_user_files extends backup_execution_step {
             'backupid' => $this->get_backupid(), 'itemname' => 'userfinal'));
         foreach ($rs as $record) {
             $userid = $record->itemid;
-            $userctx = context_user::instance($userid);
+            $userctx = context_user::instance($userid, IGNORE_MISSING);
             if (!$userctx) {
                 continue; // User has not context, sure it's a deleted user, so cannot have files
             }