From 13968b5f4424eb3218bee2eef698b91cc99d2976 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 21 Mar 2016 17:47:32 -0700 Subject: Fix error if getLastPlayed is passed null Pair --- app/src/main/java/github/daneren2005/dsub/util/SongDBHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/github/daneren2005/dsub/util/SongDBHandler.java b/app/src/main/java/github/daneren2005/dsub/util/SongDBHandler.java index f6a1714c..1309ee69 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/SongDBHandler.java +++ b/app/src/main/java/github/daneren2005/dsub/util/SongDBHandler.java @@ -162,7 +162,11 @@ public class SongDBHandler extends SQLiteOpenHelper { return getLastPlayed(getOnlineSongId(entry)); } protected synchronized Long[] getLastPlayed(Pair pair) { - return getLastPlayed(pair.getFirst(), pair.getSecond()); + if(pair == null) { + return null; + } else { + return getLastPlayed(pair.getFirst(), pair.getSecond()); + } } public synchronized Long[] getLastPlayed(int serverKey, String id) { SQLiteDatabase db = this.getReadableDatabase(); -- cgit v1.2.3