#105565Call to a member function getMessage() on null in Typo3DbBackend.php
Description
When a table does not exist because I forgot to create it, I get the following error in a form finisher:
Call to a member function getMessage() on null
in /var/www/html/vendor/typo3/cms-extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php line 90
In this line $e->getPrevious(), which is nullable is expected to always exist.
I was able to get a helpful error message by changing the line to
throw new SqlErrorException($e->getPrevious()?->getMessage()??$e->getMessage(), 1470230766, $e);Reviews 6
- 12.4 87959[BUGFIX] Avoid $e->getPrevious() on doctrine exceptions
- 13.4 87958[BUGFIX] Avoid $e->getPrevious() on doctrine exceptions
- main 86958[BUGFIX] Avoid $e->getPrevious() on doctrine exceptions
- 12.4 87763[BUGFIX] Avoid $e->getPrevious() in DH->insertDB() exceptions
- 13.4 87762[BUGFIX] Avoid $e->getPrevious() in DH->insertDB() exceptions
- main 87711[BUGFIX] Avoid $e->getPrevious() in DH->insertDB() exceptions