From bcbbb5cc4c4097b88fafec2c92d52dfc46c4bfd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=CC=81s=CC=8C=20Ludvik?= Date: Thu, 14 Nov 2024 11:03:01 +0100 Subject: [PATCH] CustomerFileNotFoundException now checks existence of App\Environment so it is working correctly on splited packages --- .../Exception/CustomerFileNotFoundException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Component/CustomerUploadedFile/Exception/CustomerFileNotFoundException.php b/src/Component/CustomerUploadedFile/Exception/CustomerFileNotFoundException.php index 9b40431098..2a9516abb5 100644 --- a/src/Component/CustomerUploadedFile/Exception/CustomerFileNotFoundException.php +++ b/src/Component/CustomerUploadedFile/Exception/CustomerFileNotFoundException.php @@ -17,7 +17,7 @@ class CustomerFileNotFoundException extends CustomerFileException */ public function __construct($message = '', ?Exception $previous = null) { - $isDev = Environment::getEnvironment() === EnvironmentType::DEVELOPMENT; + $isDev = class_exists('App\Environment') && Environment::getEnvironment() === EnvironmentType::DEVELOPMENT; if (!$isDev) { throw new NotFoundHttpException($message, $previous, 0, ['X-Accel-Redirect' => '@storefront']);