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: Catch null pointer exception for empty leader URL when assignment is null #4798

Merged
merged 1 commit into from Nov 16, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+8 −1
Diff settings

Always

Just for now

@@ -1031,7 +1031,14 @@ private void reconfigureConnector(final String connName, final Callback<Void> cb
@Override
public void run() {
try {
String reconfigUrl = RestServer.urlJoin(leaderUrl(), "/connectors/" + connName + "/tasks");
String leaderUrl = leaderUrl();
if (leaderUrl == null || leaderUrl.trim().isEmpty()) {
cb.onCompletion(new ConnectException("Request to leader to " +
"reconfigure connector tasks failed " +
"because the URL of the leader's REST interface is empty!"), null);
return;
}
String reconfigUrl = RestServer.urlJoin(leaderUrl, "/connectors/" + connName + "/tasks");
RestClient.httpRequest(reconfigUrl, "POST", rawTaskProps, null, config);
cb.onCompletion(null, null);
} catch (ConnectException e) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.