Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
moneytoo committed Aug 8, 2024
1 parent 3cc24aa commit 2dced87
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions app/src/main/java/com/brouken/player/SubtitleUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,24 +190,24 @@ public static DocumentFile findNext(DocumentFile video, DocumentFile dir) {
return null;
}

DocumentFile[] list = dir.listFiles();
try {
DocumentFile[] list = dir.listFiles();
Arrays.sort(list, (a, b) -> a.getName().compareToIgnoreCase(b.getName()));
} catch (NullPointerException e) {
return null;
}

final String videoName = video.getName();
boolean matchFound = false;
final String videoName = video.getName();
boolean matchFound = false;

for (DocumentFile file : list) {
if (file.getName().equals(videoName)) {
matchFound = true;
} else if (matchFound) {
if (isVideoFile(file)) {
return file;
for (DocumentFile file : list) {
if (file.getName().equals(videoName)) {
matchFound = true;
} else if (matchFound) {
if (isVideoFile(file)) {
return file;
}
}
}
} catch (NullPointerException e) {
e.printStackTrace();
}

return null;
Expand Down

0 comments on commit 2dced87

Please sign in to comment.