Null check the directory when searching for nearby browsers.

This commit is contained in:
eyedeekay
2024-07-08 16:15:19 -04:00
parent 7f409bfc1f
commit fbbaffddb9

View File

@ -594,6 +594,8 @@ public class I2PCommonBrowser {
* @return the found file or null if not found
*/
public File searchFile(File directory, String search) {
if (directory == null || !directory.exists() || !directory.canRead())
return null;
if (directory.isDirectory()) {
File[] files = directory.listFiles();
for (File file : files) {