[BUGFIX] Convert eID null return values to a NullResponse 71/55671/3
authorBenjamin Franzke <bfr@qbus.de>
Mon, 12 Feb 2018 08:27:51 +0000 (09:27 +0100)
committerFrank Naegler <frank.naegler@typo3.org>
Mon, 12 Feb 2018 15:27:07 +0000 (16:27 +0100)
An eID script (like FileDumpController) might return null.
We need to convert that to a NullResponse in order to be
propagatable back through the middleware stack.

Change-Id: I75dde1a019a9925fd70ab36bd2dddc6efb110d4c
Releases: master
Resolves: #83854
Reviewed-on: https://review.typo3.org/55671
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/frontend/Classes/Middleware/EidHandler.php

index 736d979..a90a2b9 100644 (file)
@@ -63,7 +63,7 @@ class EidHandler implements MiddlewareInterface
             /** @var Dispatcher $dispatcher */
             $dispatcher = GeneralUtility::makeInstance(Dispatcher::class);
             $request = $request->withAttribute('target', $configuration);
-            return $dispatcher->dispatch($request, $response);
+            return $dispatcher->dispatch($request, $response) ?? new NullResponse();
         }
 
         $scriptPath = GeneralUtility::getFileAbsFileName($configuration);