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

Minor improvements #17

Merged
merged 1 commit into from
Sep 17, 2014
Merged

Minor improvements #17

merged 1 commit into from
Sep 17, 2014

Conversation

ST-DDT
Copy link

@ST-DDT ST-DDT commented Sep 16, 2014

Added return this to Message.set(int,Part)
Fixed potential NPE in Part.setLocalizedTextParameters(String...)

@@ -445,7 +445,7 @@ public Part setLocalizedText(String id, String... parameters) {
* @return this Part for chain calls
*/
public Part setLocalizedTextParameters(String... parameters) {
this.localizedTextParameters = parameters.length == 0 ? null : parameters;
this.localizedTextParameters = parameters == null || parameters.length == 0 ? null : parameters;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really not sure about this. Can you pass a null object to this method? Doesn't it create a String array of length 1 with parameters[0] == null?

Maybe you can pass a null variable of type String[]. Would require testing maybe?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is possible to be null if you cast the null to String array or your variable of type String array is null.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok!

Ribesg added a commit that referenced this pull request Sep 17, 2014
@Ribesg Ribesg merged commit 9aea521 into Ribesg:BUKKIT-5245-v2 Sep 17, 2014
@ST-DDT ST-DDT deleted the BUKKIT-5245-v2_improvements branch September 17, 2014 18:19
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

Successfully merging this pull request may close these issues.

2 participants