mirror of https://github.com/apache/nifi.git
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:
parent
122cba0ee7
commit
e7676ffae5
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue