This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 6da83face2 [ISSUE #9765] Improve null handling in file operations
(#9766)
6da83face2 is described below
commit 6da83face23b5a44b1d01720734dbec53aefa63a
Author: yx9o <[email protected]>
AuthorDate: Tue Oct 21 16:26:40 2025 +0800
[ISSUE #9765] Improve null handling in file operations (#9766)
---
common/src/main/java/org/apache/rocketmq/common/UtilAll.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/common/src/main/java/org/apache/rocketmq/common/UtilAll.java
b/common/src/main/java/org/apache/rocketmq/common/UtilAll.java
index a42ac3f364..e44f71589c 100644
--- a/common/src/main/java/org/apache/rocketmq/common/UtilAll.java
+++ b/common/src/main/java/org/apache/rocketmq/common/UtilAll.java
@@ -645,8 +645,10 @@ public class UtilAll {
file.delete();
} else if (file.isDirectory()) {
File[] files = file.listFiles();
- for (File file1 : files) {
- deleteFile(file1);
+ if (files != null) {
+ for (File file1 : files) {
+ deleteFile(file1);
+ }
}
file.delete();
}