Issue Bug Closed

#71951f:debug() fails when lazy loading properties result in NULL

Sebastian Michaelsen 11/29/15, 10:32 updated 10/21/17, 17:45

Description

DebuggerUtility::renderObject() recognizes LazyLoadingProxy s and resolves them. But then it just assumes the value is still an object, but the lazy loading resolution may also result in NULL. This results in the following error:

http://shots.michaelsen.io/Mmlg

The lazy loading resolution in DebuggerUtility::renderObject() should look like this:

        if ($object instanceof \TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy) {
            $object = $object->_loadRealInstance();
            if (is_null($object)) {
                return gettype($object);
            }
        }

Reviews 2