diff --git a/wmserver/src/window_manager_service.cpp b/wmserver/src/window_manager_service.cpp index 875dba74553a874bd5db14c9116bf19b395ee26f..12a9b7d61c19383f20994efdbae3445c43f42dd8 100644 --- a/wmserver/src/window_manager_service.cpp +++ b/wmserver/src/window_manager_service.cpp @@ -1149,7 +1149,11 @@ WMError WindowManagerService::SetWindowAnimationController(const sptrAsObject()->AddDeathRecipient(deathRecipient); + if (controller->AsObject() != nullptr) { + controller->AsObject()->AddDeathRecipient(deathRecipient); + } else { + WLOGFE("Convert controller as object failed"); + } RemoteAnimation::SetWindowControllerAndRoot(windowController_, windowRoot_); RemoteAnimation::SetMainTaskHandler(handler_); auto task = [this, &controller]() {