[BUGFIX] Prevent crash in Install Tool and EM with invalid ext_tables.sql
[Packages/TYPO3.CMS.git] / typo3 / sysext / install / Classes / Controller / Action / Tool / ImportantActions.php
index c41dc7a..9c3c3e0 100644 (file)
@@ -88,7 +88,14 @@ class ImportantActions extends Action\AbstractAction
             $actionMessages = array_merge($actionMessages, $this->databaseAnalyzerExecute());
         }
         if (isset($this->postValues['set']['databaseAnalyzerAnalyze'])) {
-            $actionMessages[] = $this->databaseAnalyzerAnalyze();
+            try {
+                $actionMessages[] = $this->databaseAnalyzerAnalyze();
+            } catch (\TYPO3\CMS\Core\Database\Schema\Exception\StatementException $e) {
+                $message = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
+                $message->setTitle('Database analysis failed');
+                $message->setMessage($e->getMessage());
+                $actionMessages[] = $message;
+            }
         }
 
         $this->view->assign('actionMessages', $actionMessages);