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

Error on retrieving Firewall if there is a rule with "any" port #71

Open
stefangeorgescu opened this issue Apr 27, 2021 · 3 comments
Open

Comments

@stefangeorgescu
Copy link
Contributor

$firewall = $this->client->firewalls()->getByName('name');
I'm receiving the following error when retrieving a Firewall which has a rule with an "any" port:

PHP Fatal error: Uncaught TypeError: Argument 5 passed to LKDev\HetznerCloud\Models\Firewalls\FirewallRule::__construct() must be of the type string, null given, called in /vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/Firewalls/Firewall.php on line 112 and defined in /vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/Firewalls/FirewallRule.php:48 Stack trace: #0 /vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/Firewalls/Firewall.php(112): LKDev\HetznerCloud\Models\Firewalls\FirewallRule->__construct('in', 'icmp', Array, Array, NULL) #1 /vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/Firewalls/Firewalls.php(129): LKDev\HetznerCloud\Models\Firewalls\Firewall::parse(Object(stdClass)) #2 [internal function]: LKDev\HetznerCloud\Models\Firewalls\Firewalls->LKDev\HetznerCloud\Models\Firewalls\{closure}(Object(stdClass), 0) #3 /vendor/tightenco/collect/src/Collect/Support/Collection.ph in /vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/Firewalls/FirewallRule.php on line 48

The issue should be easy to resolve adding null to the $port parameter type casting in FirewallRule.

@LKaemmerling
Copy link
Collaborator

Hey @stefangeorgescu,

thank you for your report! I won't have the time to fix this in this week, would it be possible that you contribute the fix :)?

Thank you!

@stefangeorgescu
Copy link
Contributor Author

Sure, here you go #72

@MatusBoa
Copy link

Hey @LKaemmerling

this issue seems to be resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants