diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-06-04 18:15:47 +0200 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-06-04 18:15:47 +0200 |
commit | d4b0ae6e0054645640b43bafde094f3384738d21 (patch) | |
tree | b9dcb077ab829bfd401bb6e733e7141390d7f008 /app/src/main/java/de/danoeh | |
parent | 23971da9c6063c036f38b1e42f66a075585dc9af (diff) | |
parent | 6c24614e66621ceb6246edc0c3a7081e40d8b726 (diff) | |
download | AntennaPod-d4b0ae6e0054645640b43bafde094f3384738d21.zip |
Merge pull request #1987 from AntennaPod/1.6.0_devel
1.6.0.9
Diffstat (limited to 'app/src/main/java/de/danoeh')
3 files changed, 11 insertions, 7 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java index f22507f4c..81d727283 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java @@ -189,6 +189,9 @@ public class StorageErrorActivity extends AppCompatActivity { } else { path = getExternalFilesDir(null); } + if(path == null) { + return; + } String message = null; if(!path.exists()) { message = String.format(getString(R.string.folder_does_not_exist_error), dir); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index a4ffebae2..8531a7356 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -112,7 +112,7 @@ public class VideoplayerActivity extends MediaplayerActivity { @Override protected boolean loadMediaInfo() { - if (!super.loadMediaInfo()) { + if (!super.loadMediaInfo() || controller == null) { return false; } Playable media = controller.getMedia(); @@ -152,7 +152,7 @@ public class VideoplayerActivity extends MediaplayerActivity { @Override protected void onAwaitingVideoSurface() { - if (videoSurfaceCreated) { + if (videoSurfaceCreated && controller != null) { Log.d(TAG, "Videosurface already created, setting videosurface now"); Pair<Integer, Integer> videoSize = controller.getVideoSize(); @@ -240,7 +240,7 @@ public class VideoplayerActivity extends MediaplayerActivity { public void surfaceCreated(SurfaceHolder holder) { Log.d(TAG, "Videoview holder created"); videoSurfaceCreated = true; - if (controller.getStatus() == PlayerStatus.PLAYING) { + if (controller != null && controller.getStatus() == PlayerStatus.PLAYING) { if (controller.serviceAvailable()) { controller.setVideoSurface(holder); } else { @@ -254,7 +254,7 @@ public class VideoplayerActivity extends MediaplayerActivity { public void surfaceDestroyed(SurfaceHolder holder) { Log.d(TAG, "Videosurface was destroyed"); videoSurfaceCreated = false; - if (!destroyingDueToReload) { + if (controller != null && !destroyingDueToReload) { controller.notifyVideoSurfaceAbandoned(); } } diff --git a/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java b/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java index 323060f81..007a4d744 100644 --- a/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java +++ b/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java @@ -196,9 +196,10 @@ public class PlayerWidgetService extends Service { public void onServiceConnected(ComponentName className, IBinder service) { Log.d(TAG, "Connection to service established"); synchronized (psLock) { - playbackService = ((PlaybackService.LocalBinder) service) - .getService(); - startViewUpdaterIfNotRunning(); + if(service instanceof PlaybackService.LocalBinder) { + playbackService = ((PlaybackService.LocalBinder) service).getService(); + startViewUpdaterIfNotRunning(); + } } } |