#vulnerable code 
                                public String languageGuesser(String fileName) {

        fileName = fileName.toLowerCase();
        String extension = this.getExtension(fileName);

        for (String key: database.keySet()) {
            FileClassifierResult fileClassifierResult = database.get(key);

            for (String ext: fileClassifierResult.extensions) {
                if (extension.equals(ext)) {
                    return key;
                }
            }
        }

        return Values.UNKNOWN_LANGUAGE;
    } 
                            #location 9 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                public String languageGuesser(String fileName) {
        fileName = fileName.toLowerCase();
        String extension;

        Optional<String> lang = this.checkIfExtentionExists(fileName);

        if (!lang.isPresent()) {
            extension = this.getExtension(fileName);
            lang = this.checkIfExtentionExists(extension);
        }

        if (!lang.isPresent()) {
            extension = this.getExtension(fileName);
            lang = this.checkIfExtentionExists(extension);
        }

        return lang.orElse(Values.UNKNOWN_LANGUAGE);
    }