Skip to content

Commit 49e9ddd

Browse files
committed
添加空值检查
1 parent 1b9b010 commit 49e9ddd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

fuzz/build_oss_fuzz.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,11 @@ def run_command(
6262
errors="replace"
6363
)
6464
with open(log_file, "a", encoding="utf-8") as f:
65-
for line in iter(process.stdout.readline, ""):
66-
f.write(line)
65+
if process.stdout is not None:
66+
for line in iter(process.stdout.readline, ""):
67+
f.write(line)
68+
else:
69+
log_and_print("⚠️ Warning: process.stdout is None", log_file)
6770
process.wait()
6871
exit_code = process.returncode
6972
if exit_code in [0, *allowed_exit_codes]:

0 commit comments

Comments
 (0)