Skip to content

Commit effe2f1

Browse files
yingtao450claude
andcommitted
fix(ai_biz): check empty string instead of NULL pointer for event/session id
event_id and session_id are fixed-size char arrays, not pointers; NULL check was always false, replace with empty-string check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 54566cd commit effe2f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/tuya_ai_service/svc_ai_basic/src/tuya_ai_biz.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ OPERATE_RET __ai_parse_event_attr(CHAR_T *de_buf, UINT_T attr_len, AI_EVENT_ATTR
830830
PR_ERR("unknow attr type:%d", attr.type);
831831
}
832832
}
833-
if ((NULL == event->event_id) || (NULL == event->session_id)) {
833+
if ((0 == event->event_id[0]) || (0 == event->session_id[0])) {
834834
PR_ERR("event id or session id is null");
835835
return OPRT_INVALID_PARM;
836836
}

0 commit comments

Comments
 (0)