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

net/wireguard: Fixed array_merge error for removed peers #3180

Merged
merged 1 commit into from Nov 6, 2022

Conversation

jkellerer
Copy link
Contributor

@jkellerer jkellerer commented Nov 4, 2022

This PR fixes the following error, triggered when opening the dashboard (with the Wireguard widget and a configuration with dead peers in servers):


[04-Nov-2022 13:53:07 Europe/Berlin] TypeError: array_merge(): Argument #1 must be of type array, null given in /usr/local/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/GeneralController.php:93
Stack trace:
#0 /usr/local/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/GeneralController.php(93): array_merge(NULL, Array)
#1 [internal function]: OPNsense\Wireguard\Api\GeneralController->getStatusAction()
#2 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->callActionMethod(Object(OPNsense\Wireguard\Api\GeneralController), 'getStatusAction', Array)
#3 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->dispatch()
#4 /usr/local/opnsense/www/api.php(24): Phalcon\Mvc\Application->handle('/api/wireguard/...')
#5 {main}

(Caused by the fact that $server->peers may contain peers that no longer exist)

@jkellerer jkellerer changed the title Wireguard/Widget: Fixed array_merge error for removed WG peers Wireguard/Widget: Fixed array_merge error for removed peers Nov 4, 2022
@jkellerer jkellerer changed the title Wireguard/Widget: Fixed array_merge error for removed peers net/wireguard: Fixed array_merge error for removed peers Nov 4, 2022
@fichtner fichtner self-assigned this Nov 4, 2022
@fichtner
Copy link
Member

fichtner commented Nov 4, 2022

CC @patschi

@fichtner
Copy link
Member

fichtner commented Nov 6, 2022

Looks like this was confirmed by some people already. Thanks for the patch, merged!

@fichtner fichtner merged commit 7dc3785 into opnsense:master Nov 6, 2022
@jkellerer jkellerer deleted the patch-1 branch November 6, 2022 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants