Skip to content

Commit

Permalink
Merge pull request #37 from netlogix/bugfix/undefined-global
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanowak authored Oct 29, 2024
2 parents 42275cd + 4c8c755 commit 4907d5a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/EventListener/AbstractImageOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ public function __construct()

protected function isEnabled(ProcessedFile $processedFile): bool
{
if (!ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()) {
if (
!array_key_exists('TYPO3_REQUEST', $GLOBALS) ||
!ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()
) {
// this is not needed for TYPO3 backend and would break deferred image processing
return false;
}
Expand Down

0 comments on commit 4907d5a

Please sign in to comment.