diff --git a/adapter/ohos/entrance/subwindow/subwindow_ohos.cpp b/adapter/ohos/entrance/subwindow/subwindow_ohos.cpp index e6bde4fc160..3227acbfb6b 100644 --- a/adapter/ohos/entrance/subwindow/subwindow_ohos.cpp +++ b/adapter/ohos/entrance/subwindow/subwindow_ohos.cpp @@ -1150,10 +1150,11 @@ void SubwindowOhos::HideSubWindowNG() Platform::DialogContainer::DestroyContainer(Container::CurrentId()); } } else { - HideWindow(); auto context = container->GetPipelineContext(); - CHECK_NULL_VOID(context); - context->FlushPipelineImmediately(); + if (context) { + context->FlushPipelineImmediately(); + } + HideWindow(); } }