Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/api/v1/firewall/nat/outbound/mapping throws error when no mappings exist #385

Closed
jaredhendrickson13 opened this issue Jul 29, 2023 · 0 comments · Fixed by #386
Closed
Labels
bug Something isn't working

Comments

@jaredhendrickson13
Copy link
Owner

Describe the bug
When adding a new outbound NAT mapping to a pfSense instance with no outbound NAT mappings, an error is thrown.

Expected behavior
The outbound NAT mapping should be created.

Screenshots or Response

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /etc/inc/api/models/APIFirewallNATOutboundMappingCreate.inc:39\nStack trace:\n#0 /etc/inc/api/framework/APIModel.inc(216): APIFirewallNATOutboundMappingCreate->action()\n#1 /etc/inc/api/endpoints/APIFirewallNATOutboundMapping.inc(28): APIModel->call()\n#2 /etc/inc/api/framework/APIEndpoint.inc(63): APIFirewallNATOutboundMapping->post()\n#3 /usr/local/www/api/v1/firewall/nat/outbound/mapping/index.php(3): APIEndpoint->listen()\n#4 {main}\n  thrown in /etc/inc/api/models/APIFirewallNATOutboundMappingCreate.inc on line 39\nPHP ERROR: Type: 1, File: /etc/inc/api/models/APIFirewallNATOutboundMappingCreate.inc, Line: 39, Message: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /etc/inc/api/models/APIFirewallNATOutboundMappingCreate.inc:39\nStack trace:\n#0 /etc/inc/api/framework/APIModel.inc(216): APIFirewallNATOutboundMappingCreate->action()\n#1 /etc/inc/api/endpoints/APIFirewallNATOutboundMapping.inc(28): APIModel->call()\n#2 /etc/inc/api/framework/APIEndpoint.inc(63): APIFirewallNATOutboundMapping->post()\n#3 /usr/local/www/api/v1/firewall/nat/outbound/mapping/index.php(3): APIEndpoint->listen()\n#4 {main}\n  thrown"

pfSense Version & Package Version:

  • pfSense Version: 2.7.0, 23.05
  • Package Version v1.6.1 (pre-v1.6.0 is not effected.)

Affected Endpoints:

  • URL: /api/v1/firewall/nat/outbound/mapping

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant