#vulnerable code 
                                public static boolean emptyDirectory(File directory) {
        boolean result = true;
        File[] entries = directory.listFiles();
        for (int i = 0; i < entries.length; i++) {
            if (!entries[i].delete()) {
                result = false;
            }
        }
        return result;
    } 
                            #location 4 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                public static boolean emptyDirectory(File directory) {
        boolean result = true;
        File[] entries = directory.listFiles();
        for (File entry : entries) {
            if (!entry.delete()) {
                result = false;
            }
        }
        return result;
    }