We had the same issue after enabling FPC. The following error would occur:
Fatal error: Uncaught Error: Call to a member function getIdentities() on null in /vendor/magento/module-catalog/Block/Category/View.php:177
Not the most helpful error message but after some digging we found that this was being triggered by using the block type Magento\Catalog\Block\Category\View
on our homepage - presumably because there is no category initialised at that point.
This was a coding error by one of our developers as this particular block did not need that type and was fine with just Magento\Framework\View\Element\Template
which is the Magento 2 equivalent of core/template
.
PHP Fatal error: Call to a member function getIdentities() on null in /vendor/magento/module-catalog/Block/Product/View.php on line 373
The problem is in the function getIdentities() on the line:$identities = $this->getProduct()->getIdentities();
$this->getProduct()
is null when Full Page Cache is enabled.