#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
Related issues 2
Files 1
History 510
-
Lina Wolf commented and changed attached Bug105565.patch <span data-processor="relativetime" data-value="2024-11-11T07:05:37+00:00" > 11/11/24, 07:05 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 86958 status
NewUnder Review <span data-processor="relativetime" data-value="2024-11-11T19:44:10+00:00" > 11/11/24, 19:44 </span> -
Garvin Hicking changed Related to #105897 <span data-processor="relativetime" data-value="2025-01-13T12:25:51+00:00" > 01/13/25, 12:25 </span>
-
Benni Mack changed Related to #105919 <span data-processor="relativetime" data-value="2025-01-13T13:15:18+00:00" > 01/13/25, 13:15 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 86958 <span data-processor="relativetime" data-value="2025-01-31T11:04:15+00:00" > 01/31/25, 11:04 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 86958 <span data-processor="relativetime" data-value="2025-01-31T11:17:14+00:00" > 01/31/25, 11:17 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 87958 <span data-processor="relativetime" data-value="2025-01-31T12:02:18+00:00" > 01/31/25, 12:02 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 87959 <span data-processor="relativetime" data-value="2025-01-31T12:10:59+00:00" > 01/31/25, 12:10 </span>
-
Oliver Bartsch commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-01-31T12:30:09+00:00" > 01/31/25, 12:30 </span>Applied in changeset commit:987057f810cd48f3e9146a5af6bd849caccc2b38.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:32:14+00:00" > 12/02/25, 14:32 </span>
The following patch gave me a helpful error message prventing a type error