diff --git a/interfaces/napi/kits/promptaction/prompt_action.cpp b/interfaces/napi/kits/promptaction/prompt_action.cpp index 7765b905897..9a0c5f55a27 100644 --- a/interfaces/napi/kits/promptaction/prompt_action.cpp +++ b/interfaces/napi/kits/promptaction/prompt_action.cpp @@ -240,7 +240,7 @@ bool GetShadowFromTheme(ShadowStyle shadowStyle, Shadow& shadow) if (shadowStyle == ShadowStyle::None) { return true; } - auto container = Container::Current(); + auto container = Container::CurrentSafelyWithCheck(); CHECK_NULL_RETURN(container, false); auto pipelineContext = container->GetPipelineContext(); CHECK_NULL_RETURN(pipelineContext, false);