Skip to content

Commit

Permalink
Merge pull request #57 from owncloud/backport-55-8.2
Browse files Browse the repository at this point in the history
[8.2] Catch the exception that can be thrown as per the doc block
  • Loading branch information
nickvergessen committed Mar 7, 2016
2 parents da72836 + f7148ed commit 7be75d4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/activityextension.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,13 @@ public function translate($app, $text, $params, $stripPath, $highlightParams, $l
$params[] = $announcement['subject'];
}

if ($announcement['author'] === $this->activityManager->getCurrentUserId()) {
array_shift($params);
return (string) $l->t('You announced %s', $params);
try {
if ($announcement['author'] === $this->activityManager->getCurrentUserId()) {
array_shift($params);
return (string) $l->t('You announced %s', $params);
}
} catch (\UnexpectedValueException $e) {
// FIXME this is awkward, but we have no access to the current user in emails
}
return (string) $l->t('%s announced %s', $params);
}
Expand Down

0 comments on commit 7be75d4

Please sign in to comment.