Skip to content

Commit

Permalink
Handle null correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage committed Feb 18, 2024
1 parent f777451 commit 7389b33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Automod/ModAction/BanUser/BanUserForImageAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public function takeAction(object $object, Context $context = new Context()): Fu
error_log("Failed getting image hash: {$e->getMessage()}, {$e->getTraceAsString()}");
return FurtherAction::CanContinue;
}
if ($hash === null) {
return FurtherAction::CanContinue;
}
foreach ($this->imageRepository->findAll() as $image) {
$similarity = $this->imageComparator->compareHashStrings($hash, $image->getImageHash());
if ($similarity < $image->getSimilarityPercent()) {
Expand Down

0 comments on commit 7389b33

Please sign in to comment.