Switch order of literals to prevent NullPointerException

This commit is contained in:
pixeebot[bot] 2025-06-23 15:14:37 +00:00 committed by GitHub
parent 5aec97939e
commit 2e2d981c0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -185,9 +185,9 @@ public class TempFileCleanupService {
// Check if this is a directory we should recursively scan
if (Files.isDirectory(path)) {
// Don't recurse into certain system directories
if (!fileName.equals("proc")
&& !fileName.equals("sys")
&& !fileName.equals("dev")) {
if (!"proc".equals(fileName)
&& !"sys".equals(fileName)
&& !"dev".equals(fileName)) {
deletedCount +=
cleanupDirectory(path, containerMode, depth + 1, maxAgeMillis);
}
@ -347,9 +347,9 @@ public class TempFileCleanupService {
// Check if this is a directory we should recursively scan
if (Files.isDirectory(path)) {
// Don't recurse into certain system directories
if (!fileName.equals("proc")
&& !fileName.equals("sys")
&& !fileName.equals("dev")) {
if (!"proc".equals(fileName)
&& !"sys".equals(fileName)
&& !"dev".equals(fileName)) {
deletedCount += cleanupDirectory(path, containerMode, depth + 1);
}
continue;