Make error-checking in sendPowerControlEvent() more meaningful.
It checks getPowerStateHandler()'s return value against nullptr, but
that had previously been returning a no-op function on error instead
of null.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I65a33db51769ba579cd7c7f99ee3bac7aab69776
diff --git a/power-control-x86/src/power_control.cpp b/power-control-x86/src/power_control.cpp
index ab704d8..8daf4b7 100644
--- a/power-control-x86/src/power_control.cpp
+++ b/power-control-x86/src/power_control.cpp
@@ -363,7 +363,7 @@
return powerStateCheckForWarmReset;
break;
default:
- return std::function<void(const Event)>{};
+ return nullptr;
break;
}
};