diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-10-26 10:07:28 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-10-26 10:07:28 -0700 |
commit | 666f6bb24019e5b8e74f5754049eda6983b7cdba (patch) | |
tree | e4a621fa3fca1396382e6135798d7c7f0f261296 /src | |
parent | 1fa2f0825f8371be4e2302380dcc285d92ed8e95 (diff) | |
download | dsub-666f6bb24019e5b8e74f5754049eda6983b7cdba.tar.gz dsub-666f6bb24019e5b8e74f5754049eda6983b7cdba.tar.bz2 dsub-666f6bb24019e5b8e74f5754049eda6983b7cdba.zip |
Fix NPE when playing from empty list
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadService.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index 69ed7c7f..a5b647a9 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -1888,6 +1888,10 @@ public class DownloadService extends Service { return isPastCutoff(getPlayerPosition(), getPlayerDuration()); } private boolean isPastCutoff(int position, int duration) { + if(currentPlaying == null) { + return false; + } + int cutoffPoint = (int) (duration * DELETE_CUTOFF); boolean isPastCutoff = duration > 0 && position > cutoffPoint; |