Copilot commented on code in PR #59117:
URL: https://github.com/apache/doris/pull/59117#discussion_r2629941184


##########
be/src/olap/rowset/segment_v2/inverted_index_iterator.cpp:
##########
@@ -71,7 +97,7 @@ Status InvertedIndexIterator::read_from_index(const 
IndexParam& param) {
                              i_param->query_type, i_param->roaring, 
i_param->analyzer_ctx);
     };
 
-    if (runtime_state->query_options().enable_profile) {
+    if (runtime_state != nullptr && 
runtime_state->query_options().enable_profile) {

Review Comment:
   The condition checks runtime_state != nullptr before accessing 
query_options(), but in the original code this check didn't exist. This 
suggests that runtime_state could be null in some scenarios. However, the query 
execution path that follows this block doesn't have similar null checks, which 
could lead to crashes if runtime_state is actually null in practice. Review 
whether runtime_state can legitimately be null here and add consistent null 
handling throughout the method if so.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to