Android - Recursive file search gives NullPointerException
===

I have the following function to recursively search for a string within files, however it keeps giving a NullPointerException. When it is first called it seems to work, but once it calls itself 'files' is null.

    
	public void recursiveSearch(File searchDirectory, String searchString){
		File[] files = searchDirectory.listFiles();	
			for (int i = 0; i < files.length; i++) {
				if (files[i].isDirectory()){
					recursiveSearch(files[i], searchString);
				}
				if (files[i].getName().contains(searchString)){
					searchResultFiles.add(files[i]);
				}
			}
	}

Here is an example of how it is called:

    recursiveSearch("/", "abc");
