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

fix: replace VaultisPluginEnabled check with null check as plugin not necessarily enabled yet #4432

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Test-Account666
Copy link

Overview

In some cases, the isPluginEnabled check will cause the NullEconHandler to be used - Even though everything will work out.

Description

I noticed that PlotSquared will use the NullEconHandler in some scenarios.
One of them is when the plugin providing the Economy is depending on Vault and PlotSquared.

I fixed this by replacing the Vault isPluginEnabled check with a null check.

The VaultPermissionHandler is also affected, although I don't know what's causing the issue here.
I did not replace the isPluginEnabled this time, as it breaks permissions otherwise (See previous pull request).

Note that I kept the Vault isPluginEnabled check in the ServerListener, since Vault is going to be enabled at this point.

Submitter Checklist

Fixes vault economy interactions.
@Test-Account666 Test-Account666 requested a review from a team as a code owner May 21, 2024 17:26
@github-actions github-actions bot added the Bugfix This PR fixes a bug label May 21, 2024
@TheMeinerLP
Copy link
Member

Have you tested ?

@Test-Account666
Copy link
Author

Have you tested ?

This time, I tested the merge command, yes.

Without enough money, the merge will fail, as expected.

With enough money, the merge will succeed and withdraw the correct amount.

I also used the unlink command and tried again, for good measure.

If I should be doing more than that, please tell me :)

@dordsor21 dordsor21 changed the title Replace isPluginEnabled check with null check. Fixes vault economy interactions. fix: replace VaultisPluginEnabled check with null check as plugin not necessarily enabled yet Jun 1, 2024
@dordsor21
Copy link
Member

dordsor21 commented Jun 1, 2024

What exactly breaks by making the same change elsewhere, e.g. for permission handler?

@Test-Account666
Copy link
Author

What exactly breaks by making the same change elsewhere, e.g. for permission handler?

I actually didn't investigate to why this happens.

Permission checking straight up doesn't work anymore.

PlotSquared thinks nobody has permission to do anything

@dordsor21
Copy link
Member

dordsor21 commented Jun 2, 2024

IHmm okay, so I suppose the vault permissions module is just never used then, which is why permissions continue to work? It might be worth forcefully disabling it to be sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix This PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants