#vulnerable code 
                                public static List<String> getRegionNames(Location location) {
        if (!isInRegion(location)) {
            return null;
        }
        
        List<String> regionNames = new ArrayList<>();
        getRegionSet(location).getRegions().forEach(r -> regionNames.add(r.getId()));
        
        return regionNames;
    } 
                            #location 7 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                public static List<String> getRegionNames(Location location) {
        ApplicableRegionSet regionSet = getRegionSet(location);
        return regionSet != null ? regionSet.getRegions().stream().map(ProtectedRegion::getId)
                                                                  .collect(Collectors.toList())
                                 : null;
    }