Added a null check against Intent.action for SystemService::onStartCommand

This commit is contained in:
casey langen 2017-08-04 19:12:58 -07:00
parent 0b7d61df50
commit bae32b6d78

View File

@ -60,7 +60,7 @@ class SystemService : Service() {
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
if (intent != null) {
if (intent != null && intent.action != null) {
when (intent.action) {
ACTION_WAKE_UP -> wakeupNow()
ACTION_SHUT_DOWN -> shutdownNow()