#vulnerable code 
                                @SuppressWarnings("rawtypes")
    private void parseStrategyCondition(Element element, List<StrategyConditionEntity> strategyConditionEntityList) {
        for (Iterator elementIterator = element.elementIterator(); elementIterator.hasNext();) {
            Object childElementObject = elementIterator.next();
            if (childElementObject instanceof Element) {
                Element childElement = (Element) childElementObject;

                if (StringUtils.equals(childElement.getName(), ConfigConstant.CONDITION_ELEMENT_NAME)) {
                    StrategyConditionEntity strategyConditionEntity = new StrategyConditionEntity();

                    Attribute idAttribute = childElement.attribute(ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (idAttribute == null) {
                        throw new DiscoveryException("Attribute[" + ConfigConstant.ID_ATTRIBUTE_NAME + "] in element[" + childElement.getName() + "] is missing");
                    }
                    String id = idAttribute.getData().toString().trim();
                    strategyConditionEntity.setId(id);

                    Attribute headerAttribute = childElement.attribute(ConfigConstant.HEADER_ATTRIBUTE_NAME);
                    if (headerAttribute == null) {
                        throw new DiscoveryException("Attribute[" + ConfigConstant.HEADER_ATTRIBUTE_NAME + "] in element[" + childElement.getName() + "] is missing");
                    }
                    String header = headerAttribute.getData().toString().trim();
                    strategyConditionEntity.setConditionHeader(header);
                    List<String> headerList = StringUtil.splitToList(header, DiscoveryConstant.SEPARATE);
                    for (String value : headerList) {
                        String[] valueArray = StringUtils.split(value, DiscoveryConstant.EQUALS);
                        String headerName = valueArray[0].trim();
                        String headerValue = valueArray[1].trim();

                        strategyConditionEntity.getConditionHeaderMap().put(headerName, headerValue);
                    }

                    Attribute versionIdAttribute = childElement.attribute(ConfigConstant.VERSION_ELEMENT_NAME + DiscoveryConstant.DASH + ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (versionIdAttribute != null) {
                        String versionId = versionIdAttribute.getData().toString().trim();
                        strategyConditionEntity.setVersionId(versionId);
                    }

                    Attribute regionIdAttribute = childElement.attribute(ConfigConstant.REGION_ELEMENT_NAME + DiscoveryConstant.DASH + ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (regionIdAttribute != null) {
                        String regionId = regionIdAttribute.getData().toString().trim();
                        strategyConditionEntity.setRegionId(regionId);
                    }

                    Attribute addressIdAttribute = childElement.attribute(ConfigConstant.ADDRESS_ELEMENT_NAME + DiscoveryConstant.DASH + ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (addressIdAttribute != null) {
                        String addressId = addressIdAttribute.getData().toString().trim();
                        strategyConditionEntity.setAddressId(addressId);
                    }

                    Attribute versionWeightIdAttribute = childElement.attribute(ConfigConstant.VERSION_WEIGHT_ELEMENT_NAME + DiscoveryConstant.DASH + ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (versionWeightIdAttribute != null) {
                        String versionWeightId = versionWeightIdAttribute.getData().toString().trim();
                        strategyConditionEntity.setVersionWeightId(versionWeightId);
                    }

                    Attribute regionWeightIdAttribute = childElement.attribute(ConfigConstant.REGION_WEIGHT_ELEMENT_NAME + DiscoveryConstant.DASH + ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (regionWeightIdAttribute != null) {
                        String regionWeightId = regionWeightIdAttribute.getData().toString().trim();
                        strategyConditionEntity.setRegionWeightId(regionWeightId);
                    }

                    strategyConditionEntityList.add(strategyConditionEntity);
                }
            }
        }
    } 
                            #location 25 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @SuppressWarnings("rawtypes")
    private void parseStrategyCondition(Element element, List<StrategyConditionEntity> strategyConditionEntityList) {
        for (Iterator elementIterator = element.elementIterator(); elementIterator.hasNext();) {
            Object childElementObject = elementIterator.next();
            if (childElementObject instanceof Element) {
                Element childElement = (Element) childElementObject;

                if (StringUtils.equals(childElement.getName(), ConfigConstant.CONDITION_ELEMENT_NAME)) {
                    StrategyConditionEntity strategyConditionEntity = new StrategyConditionEntity();

                    Attribute idAttribute = childElement.attribute(ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (idAttribute == null) {
                        throw new DiscoveryException("Attribute[" + ConfigConstant.ID_ATTRIBUTE_NAME + "] in element[" + childElement.getName() + "] is missing");
                    }
                    String id = idAttribute.getData().toString().trim();
                    strategyConditionEntity.setId(id);

                    Attribute headerAttribute = childElement.attribute(ConfigConstant.HEADER_ATTRIBUTE_NAME);
                    if (headerAttribute == null) {
                        throw new DiscoveryException("Attribute[" + ConfigConstant.HEADER_ATTRIBUTE_NAME + "] in element[" + childElement.getName() + "] is missing");
                    }
                    String header = headerAttribute.getData().toString().trim();
                    strategyConditionEntity.setConditionHeader(header);

                    Attribute versionIdAttribute = childElement.attribute(ConfigConstant.VERSION_ELEMENT_NAME + DiscoveryConstant.DASH + ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (versionIdAttribute != null) {
                        String versionId = versionIdAttribute.getData().toString().trim();
                        strategyConditionEntity.setVersionId(versionId);
                    }

                    Attribute regionIdAttribute = childElement.attribute(ConfigConstant.REGION_ELEMENT_NAME + DiscoveryConstant.DASH + ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (regionIdAttribute != null) {
                        String regionId = regionIdAttribute.getData().toString().trim();
                        strategyConditionEntity.setRegionId(regionId);
                    }

                    Attribute addressIdAttribute = childElement.attribute(ConfigConstant.ADDRESS_ELEMENT_NAME + DiscoveryConstant.DASH + ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (addressIdAttribute != null) {
                        String addressId = addressIdAttribute.getData().toString().trim();
                        strategyConditionEntity.setAddressId(addressId);
                    }

                    Attribute versionWeightIdAttribute = childElement.attribute(ConfigConstant.VERSION_WEIGHT_ELEMENT_NAME + DiscoveryConstant.DASH + ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (versionWeightIdAttribute != null) {
                        String versionWeightId = versionWeightIdAttribute.getData().toString().trim();
                        strategyConditionEntity.setVersionWeightId(versionWeightId);
                    }

                    Attribute regionWeightIdAttribute = childElement.attribute(ConfigConstant.REGION_WEIGHT_ELEMENT_NAME + DiscoveryConstant.DASH + ConfigConstant.ID_ATTRIBUTE_NAME);
                    if (regionWeightIdAttribute != null) {
                        String regionWeightId = regionWeightIdAttribute.getData().toString().trim();
                        strategyConditionEntity.setRegionWeightId(regionWeightId);
                    }

                    strategyConditionEntityList.add(strategyConditionEntity);
                }
            }
        }
    }