Issue Bug Closed

#105565Call to a member function getMessage() on null in Typo3DbBackend.php

Lina Wolf 11/11/24, 07:01 updated 12/02/25, 14:32

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

Files 1

History 510

  1. 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>

    The following patch gave me a helpful error message prventing a type error

  2. Oliver Bartsch commented and changed status Under Review Resolved done 0 % 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.