Fix multiple bugs in chat plugin integrations and Vault - #948
Open
Smorki wants to merge 1 commit into
Open
Conversation
Author
|
can anyone review? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes four small but real bugs I noticed while reading through the codebase.
1.
Chat_PermissionsEx— null check on wrong variableFour methods (
getGroupPrefix,setGroupPrefix,getGroupSuffix,setGroupSuffix) checkif (group != null)wheregroupis theStringparameter (never null in practice) instead ofpGroup, the resolvedPermissionGroup(which CAN be null if the group name doesn't exist). This means when a non-existent group name is passed, the null check silently passes and the next line NPEs onpGroup.Fix: Check
pGroup != nullinstead ofgroup != null.2.
Chat_OverPermissions—setGroupSuffixwrites to"prefix"keyCopy-paste bug:
setGroupSuffixcallssetGroupInfoString(world, group, "prefix", suffix), overwriting the group's prefix with the suffix value instead of setting the suffix.Fix:
"prefix"→"suffix".3.
Vault.java— missing null check infindCustomDatafindCustomDatanull-checks theRegisteredServiceProviderforEconomyandChatbefore calling.getProvider(), but does not null-checkPermission. If no permission provider is registered (edge case, but possible), this would NPE.Fix: Apply the same null-check pattern used for Economy and Chat, defaulting to
"No Permission"when unavailable.4.
Vault.java— typo "Converson" → "Conversion"Admin-facing typo in the
/vault-convertcommand output.Notes
Chat_PermissionsExandChat_OverPermissionsbugs affect users of those permission plugins when calling group-related methods.Vault.javanull-check brings consistency with the existing Economy/Chat handling pattern in the same method.