Affected Version
2026.2
Affected capability
Assets
Steps to reproduce
-
Construct a thumbnail without a backing asset, which the API allows since ImageThumbnailTrait::$asset is declared ?Asset:
$thumbnail = new \Pimcore\Model\Asset\Video\ImageThumbnail(null);
(In practice this happens when a thumbnail is built from a raw path reference or the underlying asset can no longer be resolved.)
-
Call $thumbnail->getAsset() — directly, or indirectly by rendering the thumbnail via __toString() / getPath(), or through the ASSET_*_THUMBNAIL frontend events.
Actual Behavior
The method crashes inside itself:
TypeError: Pimcore\Model\Asset\Thumbnail\ImageThumbnailTrait::getAsset():
Return value must be of type Pimcore\Model\Asset, null returned
ImageThumbnailInterface::getAsset() and ImageThumbnailTrait::getAsset() both declare : Asset, which contradicts the nullable ?Asset $asset property they read from. Related call sites in the trait (getDimensions(), getFileSize()) also dereference the result unguarded.
Expected Behavior
getAsset() declares ?Asset, matching the property and the actual runtime behaviour, so callers can handle the absent-asset case instead of the getter throwing. Fixed by pimcore/pimcore#19277 (targets 2026.x, as widening a public API return type to nullable affects callers).
Affected Version
2026.2
Affected capability
Assets
Steps to reproduce
Construct a thumbnail without a backing asset, which the API allows since
ImageThumbnailTrait::$assetis declared?Asset:(In practice this happens when a thumbnail is built from a raw path reference or the underlying asset can no longer be resolved.)
Call
$thumbnail->getAsset()— directly, or indirectly by rendering the thumbnail via__toString()/getPath(), or through theASSET_*_THUMBNAILfrontend events.Actual Behavior
The method crashes inside itself:
ImageThumbnailInterface::getAsset()andImageThumbnailTrait::getAsset()both declare: Asset, which contradicts the nullable?Asset $assetproperty they read from. Related call sites in the trait (getDimensions(),getFileSize()) also dereference the result unguarded.Expected Behavior
getAsset()declares?Asset, matching the property and the actual runtime behaviour, so callers can handle the absent-asset case instead of the getter throwing. Fixed by pimcore/pimcore#19277 (targets2026.x, as widening a public API return type to nullable affects callers).