NIFI-1546: - Ensuring that the data reference query is not null before attempt to extract a cluster node id from it.

Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
Matt Gilman 2016-02-22 09:32:12 -05:00 committed by joewitt
parent 122cba0ee7
commit e7676ffae5
1 changed files with 7 additions and 4 deletions

View File

@ -293,12 +293,15 @@ public class ContentViewerController extends HttpServlet {
final URI refUri = URI.create(ref);
final String query = refUri.getQuery();
final String[] queryParameters = query.split("&");
String rawClusterNodeId = null;
for (int i = 0; i < queryParameters.length; i++) {
if (queryParameters[0].startsWith("clusterNodeId=")) {
rawClusterNodeId = StringUtils.substringAfterLast(queryParameters[0], "clusterNodeId=");
if (query != null) {
final String[] queryParameters = query.split("&");
for (int i = 0; i < queryParameters.length; i++) {
if (queryParameters[0].startsWith("clusterNodeId=")) {
rawClusterNodeId = StringUtils.substringAfterLast(queryParameters[0], "clusterNodeId=");
}
}
}
final String clusterNodeId = rawClusterNodeId;