mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Return the SessionHandler if WC session is null
Without this REST API request on the admin side return 500 as the is_admin check is not enough
This commit is contained in:
parent
4a5e805534
commit
40d23710c6
1 changed files with 3 additions and 0 deletions
|
@ -13,6 +13,9 @@ return [
|
|||
if (is_admin()) {
|
||||
return new SessionHandler();
|
||||
}
|
||||
if (is_null(WC()->session)) {
|
||||
return new SessionHandler();
|
||||
}
|
||||
$result = WC()->session->get(SessionHandler::ID);
|
||||
if (is_a($result, SessionHandler::class)) {
|
||||
return $result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue