diff --git a/interfaces/native/node/style_modifier.cpp b/interfaces/native/node/style_modifier.cpp index d8b937244e8..f49c21b1f1c 100644 --- a/interfaces/native/node/style_modifier.cpp +++ b/interfaces/native/node/style_modifier.cpp @@ -9549,7 +9549,7 @@ int32_t SetAutoResize(ArkUI_NodeHandle node, const ArkUI_AttributeItem* item) int32_t SetAlt(ArkUI_NodeHandle node, const ArkUI_AttributeItem* item) { - if (!item || !item->string || !item->object) { + if (!item || (!item->string && !item->object)) { return ERROR_CODE_PARAM_INVALID; } auto* fullImpl = GetFullImpl();