From 663bdfac27598d4e94673a8ed74e83cdfd373df8 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 7 Jan 2014 06:42:47 -0800 Subject: Fix another strange crash in logs --- src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index a6d7ff4d..671b164a 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -297,9 +297,11 @@ public class DownloadServiceImpl extends Service implements DownloadService { offset = 0; } for (MusicDirectory.Entry song : songs) { - DownloadFile downloadFile = new DownloadFile(this, song, save); - downloadList.add(getCurrentPlayingIndex() + offset, downloadFile); - offset++; + if(song != null) { + DownloadFile downloadFile = new DownloadFile(this, song, save); + downloadList.add(getCurrentPlayingIndex() + offset, downloadFile); + offset++; + } } setNextPlaying(); revision++; -- cgit v1.2.3