#vulnerable code 
                                @Override
    public List<MasterSlaveNodeData> getAllNodes() {
        List<ChildData> childDataList = getChildren(PathHelper.getParentPath(getMasterSlavePathApi().getNodePath()));
        List<MasterSlaveNodeData> masterSlaveNodeDataList = childDataList.stream().map(MasterSlaveNodeData::new).collect(Collectors.toList());
        return masterSlaveNodeDataList;
    } 
                            #location 4 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Override
    public List<MasterSlaveNodeData> getAllNodes() {
        List<ChildData> childDataList = getChildren(PathHelper.getParentPath(getMasterSlavePathApi().getNodePath()));
        if (ListHelper.isEmpty(childDataList)) {
            return null;
        }
        List<MasterSlaveNodeData> masterSlaveNodeDataList = childDataList.stream().map(MasterSlaveNodeData::new).collect(Collectors.toList());
        return masterSlaveNodeDataList;
    }