diff options
author | Martin Fietz <martin.fietz@gmail.com> | 2018-01-10 22:44:52 +0100 |
---|---|---|
committer | Martin Fietz <martin.fietz@gmail.com> | 2018-01-10 22:44:52 +0100 |
commit | c524791c3cded7c94abf98045825b73928bcf90e (patch) | |
tree | 0bfdaec2a6c785d9ee6725a8c7fa611d64ff0420 /app/src | |
parent | ce2aeb5e90e9d3b554804f47c9a13aa97d278ed5 (diff) | |
download | AntennaPod-c524791c3cded7c94abf98045825b73928bcf90e.zip |
Avoid NPEs
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java index f7cc6f942..4f56d9770 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java @@ -28,6 +28,9 @@ public class AudioplayerActivity extends MediaplayerInfoActivity { super.onResume(); if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW)) { Intent intent = getIntent(); + if (intent.getData() == null) { + return; + } Log.d(TAG, "Received VIEW intent: " + intent.getData().getPath()); ExternalMedia media = new ExternalMedia(intent.getData().getPath(), MediaType.AUDIO); @@ -41,7 +44,8 @@ public class AudioplayerActivity extends MediaplayerInfoActivity { startService(launchIntent); } else if (PlaybackService.isCasting()) { Intent intent = PlaybackService.getPlayerActivityIntent(this); - if (!intent.getComponent().getClassName().equals(AudioplayerActivity.class.getName())) { + if (intent.getComponent() != null && + !intent.getComponent().getClassName().equals(AudioplayerActivity.class.getName())) { saveCurrentFragment(); finish(); startActivity(intent); |