fix NPE when action has no timestamp

This commit is contained in:
Tom Hennen 2015-09-04 18:08:41 -04:00
parent 83aa1b15f2
commit 2292b82252
1 changed files with 3 additions and 1 deletions

View File

@ -260,8 +260,10 @@ public class GpodnetSyncService extends Service {
GpodnetEpisodeAction mostRecent = mostRecentPlayAction.get(key);
if (mostRecent == null || mostRecent.getTimestamp() == null) {
mostRecentPlayAction.put(key, action);
} else if (mostRecent.getTimestamp().before(action.getTimestamp())) {
} else if (action.getTimestamp() != null && mostRecent.getTimestamp().before(action.getTimestamp())) {
mostRecentPlayAction.put(key, action);
} else {
Log.d(TAG, "No date information in action, skipping it");
}
}
break;