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
Fix plugin_active check when plugin is not found #13531
Conversation
@@ -167,7 +167,7 @@ public function pluginExists(string $pluginName): bool | |||
*/ | |||
public function pluginEnabled(string $pluginName): bool | |||
{ | |||
return $this->getPlugin($pluginName)->plugin_active; | |||
return (bool) optional($this->getPlugin($pluginName))->plugin_active; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looksie who loves optional :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does a thing, just not the best thing.
This pull request has been mentioned on LibreNMS Community. There might be relevant details there: |
* Fix plugin_active check when plugin is not found * update baseline * revert incorrect commit
* Fix plugin_active check when plugin is not found * update baseline * revert incorrect commit
* Fix plugin_active check when plugin is not found * update baseline * revert incorrect commit
Error when loading hook App\Plugins\ExamplePlugin\Settings of type App\Plugins\Hooks\SettingsHook for ExamplePlugin: Attempt to read property "plugin_active" on null
Please note
Testers
If you would like to test this pull request then please run:
./scripts/github-apply <pr_id>
, i.e./scripts/github-apply 5926
After you are done testing, you can remove the changes with
./scripts/github-remove
. If there are schema changes, you can ask on discord how to revert.