Skip to content
Snippets Groups Projects

(fix): catch "entity cannot be paywalled" exception

Merged Marcelo Rivera requested to merge fix/sentry-issue-927 into master
1 file
+ 8
2
Compare changes
  • Side-by-side
  • Inline
+ 8
2
<?php
namespace Minds\Core\Media;
use Minds\Core;
@@ -23,8 +24,13 @@ class Thumbnails
$loggedInUser = Core\Session::getLoggedinUser();
if (!Di::_()->get('Wire\Thresholds')->isAllowed($loggedInUser, $entity)) {
return false;
try {
if (!Di::_()->get('Wire\Thresholds')->isAllowed($loggedInUser, $entity)) {
return false;
}
} catch (\Exception $e) {
error_log('[Core/Media/Thumbnails::get] ' . $e->getMessage());
// don't do anything if the entity cannot be paywalled
}
$user = $entity->getOwnerEntity(false);
Loading