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

Update build.gradle #44

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

Update build.gradle #44

wants to merge 1 commit into from

Conversation

biaji
Copy link

@biaji biaji commented Mar 2, 2023

Use 1.2.1 instead to avoid following error:

MqttConnectOptions.setUserName in 1.2.0 has a empty string check(removed by commit ):

	public void setUserName(String userName) {
		if ((userName != null) && (userName.trim().equals(""))) {
			throw new IllegalArgumentException();
		}
		this.userName = userName;
	}

while the connect method in MqttClient will give "" as default value for username:

connOpts.setUserName(options.hasKey("username") ? options.getString("username") : "");

Which result to an IllegalArgumentException

Use 1.2.1 instead to avoid following error:

MqttConnectOptions.setUserName in 1.2.0 has a null/empty check:
```
	public void setUserName(String userName) {
		if ((userName != null) && (userName.trim().equals(""))) {
			throw new IllegalArgumentException();
		}
		this.userName = userName;
	}
```
while the connect method in MqttClient will give "" as default value for username.  And result to an IllegalArgumentException
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.

None yet

1 participant