fix(graph): filter ChatResponse.getResult() is null event #2488
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe what this PR does / why we need it
使用graph时出现了NPE。 错误详情: java.lang.NullPointerException: Cannot invoke "org.springframework.ai.chat.model.Generation.getOutput()" because the return value of "org.springframework.ai.chat.model.ChatResponse.getResult()" is null

已经有多个提交试图修复这个问题,他们添加了非空判断,但是没有完全覆盖所有的逻辑分支。比如:fix: result empty (#2464)
Does this pull request fix one issue?
Describe how you did it
Describe how to verify it
使用graph时,开开启流式响应,使用qwen-max 模型当前ChatResponse.getResult()=null的某个chunk 时会出现npe
Special notes for reviews