Skip to content

Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /../Framework/Service/Policies.php:661 #466

@aamplugin

Description

@aamplugin

When access policy is created with just a null, it technically is considered as valid JSON string, however, it causes the fatal error:

[02-Jun-2025 09:06:03 UTC] PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Policies.php:661
Stack trace:
#0 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Policies.php(626): AAM_Framework_Service_Policies->_get_array_of_arrays()
#1 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Policies.php(1047): AAM_Framework_Service_Policies->_parse_policy()
#2 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Policies.php(541): AAM_Framework_Service_Policies->_prepare_policy_item()
#3 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Policies.php(571): AAM_Framework_Service_Policies->_get_registered_policies()
#4 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Policies.php(726): AAM_Framework_Service_Policies->_get_access_level_policy_tree()
#5 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Policies.php(695): AAM_Framework_Service_Policies->_get_processed_statements()
#6 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Policies.php(294): AAM_Framework_Service_Policies->_search()
#7 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Policies.php(388): AAM_Framework_Service_Policies->get_statements()
#8 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Resource/Url.php(33): AAM_Framework_Service_Policies->statements()
#9 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Resource/BaseTrait.php(458): AAM_Framework_Resource_Url->_apply_policy()
#10 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Resource/BaseTrait.php(155): AAM_Framework_Resource_Url->_init_permissions()
#11 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Manager.php(253): AAM_Framework_Resource_Url->__construct()
#12 /var/.../wp-includes/class-wp-hook.php(324): AAM_Framework_Manager->{closure}()
#13 /var/.../wp-includes/plugin.php(205): WP_Hook->apply_filters()
#14 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/AccessLevel/BaseTrait.php(219): apply_filters()
#15 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Urls.php(333): AAM_Framework_AccessLevel_User->get_resource()
#16 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Urls.php(200): AAM_Framework_Service_Urls->_get_resource()
#17 /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Urls.php(114): AAM_Framework_Service_Urls->_get_permission_by_url()
#18 /var/.../wp-content/plugins/advanced-access-manager/application/Service/Urls.php(76): AAM_Framework_Service_Urls->is_denied()
#19 /var/.../wp-content/plugins/advanced-access-manager/application/Service/Urls.php(57): AAM_Service_Urls->authorize()
#20 /var/.../wp-content/plugins/advanced-access-manager/application/Service/Urls.php(35): AAM_Service_Urls->initialize_hooks()
#21 /var/.../wp-includes/class-wp-hook.php(324): AAM_Service_Urls->{closure}()
#22 /var/.../wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#23 /var/.../wp-includes/plugin.php(517): WP_Hook->do_action()
#24 /var/.../wp-settings.php(727): do_action()
#25 /var/.../wp-config.php(133): require_once('...')
#26 /var/.../wp-load.php(50): require_once('...')
#27 /var/.../wp-admin/admin.php(35): require_once('...')
#28 /var/.../wp-admin/plugins.php(10): require_once('...')
#29 {main}
thrown in /var/.../wp-content/plugins/advanced-access-manager/application/Framework/Service/Policies.php on line 661

Metadata

Metadata

Assignees

Labels

Projects

Status

Ready For Release

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions