mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-30 02:58:26 +08:00
improve widget_lookup
This commit is contained in:
parent
e111e4a7da
commit
32376aa8cb
@ -1,5 +1,8 @@
|
||||
# 最新动态
|
||||
|
||||
2022/11/21
|
||||
* 完善widget_lookup接口,避免访问空指针导致程序崩溃(感谢雨欣提供补丁)
|
||||
|
||||
2022/11/20
|
||||
* 增加lcd_mem的测试用例题(感谢智明提供补丁)
|
||||
|
||||
|
@ -1184,7 +1184,7 @@ static widget_t* widget_lookup_child(widget_t* widget, const char* name) {
|
||||
return_value_if_fail(widget != NULL && name != NULL, NULL);
|
||||
|
||||
WIDGET_FOR_EACH_CHILD_BEGIN(widget, iter, i)
|
||||
if (iter->name != NULL && tk_str_eq(iter->name, name)) {
|
||||
if (iter != NULL && iter->name != NULL && tk_str_eq(iter->name, name)) {
|
||||
return iter;
|
||||
}
|
||||
WIDGET_FOR_EACH_CHILD_END()
|
||||
@ -1219,7 +1219,7 @@ static widget_t* widget_lookup_all(widget_t* widget, const char* name) {
|
||||
return_value_if_fail(widget != NULL && name != NULL, NULL);
|
||||
|
||||
WIDGET_FOR_EACH_CHILD_BEGIN(widget, iter, i)
|
||||
if (iter->name != NULL && tk_str_eq(iter->name, name)) {
|
||||
if (iter != NULL && iter->name != NULL && tk_str_eq(iter->name, name)) {
|
||||
return iter;
|
||||
} else {
|
||||
iter = widget_lookup_all(iter, name);
|
||||
|
Loading…
Reference in New Issue
Block a user