#vulnerable code 
                             public PMML encodePMML(){
		List<DataField> dataFields = new ArrayList<>();

		DataField targetDataField = encodeTarget();
		dataFields.add(targetDataField);

		Integer features = getFeatures();
		for(int i = 0; i < features.intValue(); i++){
			DataField dataField = new DataField(FieldName.create("x" + String.valueOf(i + 1)), OpType.CONTINUOUS, DataType.DOUBLE);

			dataFields.add(dataField);
		}

		DataDictionary dataDictionary = new DataDictionary(dataFields);

		PMML pmml = new PMML("4.2", PMMLUtil.createHeader("JPMML-SkLearn"), dataDictionary);

		Model model = encodeModel(dataFields);

		pmml.addModels(model);

		return pmml;
	} 
                            #location 8 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public PMML encodePMML(){
		List<DataField> dataFields = new ArrayList<>();
		dataFields.add(encodeTargetField());

		int features = getNumberOfFeatures();
		for(int i = 0; i < features; i++){
			dataFields.add(encodeActiveField(i));
		}

		DataDictionary dataDictionary = new DataDictionary(dataFields);

		PMML pmml = new PMML("4.2", PMMLUtil.createHeader("JPMML-SkLearn"), dataDictionary);

		Model model = encodeModel(dataFields);

		pmml.addModels(model);

		return pmml;
	}