Fixed Call to a member function getCookieThirdParties() on null

NikitOS

Well-known member
Affected version
2.2.12
If an add-on that adds a payment provider was installed, and then it was deleted along with the files, but the payment profiles associated with this provider were not deleted, an exception occurs:
Code:
An exception occurred: [Error] Call to a member function getCookieThirdParties() on null in src/XF/App.php on line 1895

    XF\App->setupCookieConsent() in src/XF/Admin/App.php at line 44
    XF\Admin\App->setupCookieConsent() in src/XF/App.php at line 346
    XF\App->XF\{closure}() in src/XF/Container.php at line 31
    XF\Container->offsetGet() in src/XF/App.php at line 2609
    XF\App->cookieConsent() in src/XF/App.php at line 2154
    XF\App->getGlobalTemplateData() in src/XF/App.php at line 2077
    XF\App->preRender() in src/XF/Admin/App.php at line 114
    XF\Admin\App->preRender() in src/XF/Mvc/Dispatcher.php at line 397
    XF\Mvc\Dispatcher->render() in src/XF/Mvc/Dispatcher.php at line 60
    XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2483
    XF\App->run() in src/XF.php at line 524
    XF::runApp() in admin.php at line 13

The XF\Repository\Payment::getPaymentProviderHandler method may return null. It seems worth adding an appropriate check to avoid such errors.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.13).

Change log:
Don't attempt to access `getCookieThirdParties` on payment providers which may no longer exist.
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom