[BUGFIX] Handle missing repository mirrors in Languages module 09/56709/3
authorMathias Brodala <mbrodala@pagemachine.de>
Tue, 17 Apr 2018 12:57:11 +0000 (14:57 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 2 Jul 2018 11:50:17 +0000 (13:50 +0200)
If no extension repository mirror is present, properly throw the
(actually advertised) exception which is handled in the
TranslationService already.

Resolves: #83135
Releases: 8.7
Change-Id: Ic24eecd03262ae54d8ef987c4f38143575260fba
Reviewed-on: https://review.typo3.org/56709
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Riny van Tiggelen <info@online-gamer.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/extensionmanager/Classes/Utility/Repository/Helper.php

index 6ef7248..38a91ce 100644 (file)
@@ -236,6 +236,9 @@ class Helper implements \TYPO3\CMS\Core\SingletonInterface
      */
     public function getMirrors($forcedUpdateFromRemote = true)
     {
+        if ($this->repository === null) {
+            throw new ExtensionManagerException('No extension repository was found.', 1523971295);
+        }
         $assignedMirror = $this->repository->getMirrors();
         if ($forcedUpdateFromRemote || is_null($assignedMirror) || !is_object($assignedMirror)) {
             if ($forcedUpdateFromRemote || !is_file($this->getLocalMirrorListFile())) {