]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
If there's an exception in notice distribution, continue
authorEvan Prodromou <evan@status.net>
Sun, 25 Nov 2012 15:39:49 +0000 (10:39 -0500)
committerEvan Prodromou <evan@status.net>
Sun, 25 Nov 2012 15:39:49 +0000 (10:39 -0500)
classes/Notice.php

index 2c404e2550544a307c40c037f30514a00167842b..bab9a0dbfdf45f9cf11971dc66aa00c388bed879 100644 (file)
@@ -1031,9 +1031,15 @@ class Notice extends Managed_DataObject
             }
 
             foreach ($ni as $id => $source) {
-                $user = User::staticGet('id', $id);
-                if (empty($user) || $user->hasBlocked($profile) ||
-                    ($originalProfile && $user->hasBlocked($originalProfile))) {
+                try {
+                    $user = User::staticGet('id', $id);
+                    if (empty($user) ||
+                        $user->hasBlocked($profile) ||
+                        ($originalProfile && $user->hasBlocked($originalProfile))) {
+                        unset($ni[$id]);
+                    }
+                } catch (UserNoProfileException $e) {
+                    // User doesn't have a profile; invalid; skip them.
                     unset($ni[$id]);
                 }
             }