summaryrefslogtreecommitdiff
diff options
-rw-r--r--lockscreen/LockScreenAcceleratorController.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/lockscreen/LockScreenAcceleratorController.cpp b/lockscreen/LockScreenAcceleratorController.cpp
index 80436881d..49dbd3bf1 100644
--- a/lockscreen/LockScreenAcceleratorController.cpp
+++ b/lockscreen/LockScreenAcceleratorController.cpp
@@ -194,10 +194,20 @@ void AcceleratorController::OnActionActivated(CompAction& action)
CompOption::Vector options;
if (action.state() & CompAction::StateInitKey)
- action.initiate()(&action, 0, options);
+ {
+ auto const& initiate_cb = action.initiate();
+
+ if (!initiate_cb.empty())
+ initiate_cb(&action, 0, options);
+ }
if (action.state() & CompAction::StateTermKey)
- action.terminate()(&action, CompAction::StateTermTapped, options);
+ {
+ auto const& terminate_cb = action.terminate();
+
+ if (!terminate_cb.empty())
+ terminate_cb(&action, CompAction::StateTermTapped, options);
+ }
}
Accelerators::Ptr const& AcceleratorController::GetAccelerators() const