Skip to content

Commit

Permalink
fix(msgbox): do not execute init obj when obj == NULL (#3264)
Browse files Browse the repository at this point in the history
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
  • Loading branch information
FASTSHIFT and pengyiqiang committed Apr 12, 2022
1 parent 06fff4b commit 56383c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/extra/widgets/msgbox/lv_msgbox.c
Expand Up @@ -74,8 +74,8 @@ lv_obj_t * lv_msgbox_create(lv_obj_t * parent, const char * title, const char *

lv_obj_t * obj = lv_obj_class_create_obj(&lv_msgbox_class, parent);
LV_ASSERT_MALLOC(obj);
lv_obj_class_init_obj(obj);
if(obj == NULL) return NULL;
lv_obj_class_init_obj(obj);
lv_msgbox_t * mbox = (lv_msgbox_t *)obj;

if(auto_parent) lv_obj_add_flag(obj, LV_MSGBOX_FLAG_AUTO_PARENT);
Expand Down

0 comments on commit 56383c4

Please sign in to comment.