#fixed code
                             public static <T extends INode> List<T> merge(List<T> items) {
		List<Integer> parentIds = new ArrayList<>();
		ForestNodeManager<T> forestNodeManager = new ForestNodeManager<>(items);
		items.forEach(forestNode -> {
			if (forestNode.getParentId() != 0) {
				INode node = forestNodeManager.getTreeNodeAT(forestNode.getParentId());
				if (node != null) {
					node.getChildren().add(forestNode);
				} else {
					forestNodeManager.addParentId(forestNode.getId());
				}
			}
		});
		return forestNodeManager.getRoot();
	}
#vulnerable code 
                             public static <T extends INode> List<T> merge(List<T> items) {
		ForestNodeManager<T> forestNodeManager = new ForestNodeManager<>(items);
		for (T forestNode : items) {
			if (forestNode.getParentId() != 0) {
				INode node = forestNodeManager.getTreeNodeAT(forestNode.getParentId());
				node.getChildren().add(forestNode);
			}
		}
		return forestNodeManager.getRoot();
	} 
                            #location 6 
                            #vulnerability type NULL_DEREFERENCE