Check for null
This commit is contained in:
parent
557d97b450
commit
3a150ac428
|
@ -20,6 +20,9 @@ public class MediaButtonReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
Log.d(TAG, "Received intent");
|
Log.d(TAG, "Received intent");
|
||||||
|
if (intent == null || intent.getExtras() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
KeyEvent event = (KeyEvent) intent.getExtras().get(Intent.EXTRA_KEY_EVENT);
|
KeyEvent event = (KeyEvent) intent.getExtras().get(Intent.EXTRA_KEY_EVENT);
|
||||||
if (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount()==0) {
|
if (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount()==0) {
|
||||||
ClientConfig.initialize(context);
|
ClientConfig.initialize(context);
|
||||||
|
|
Loading…
Reference in New Issue