Skip to content

Commit 01f2bd4

Browse files
author
johan
committed
seems session id may be empty in returned payload
1 parent e385dbb commit 01f2bd4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/com/echonest/api/v4/DynamicPlaylistSession.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public enum FeedbackType {
3232
this.sessionID = sessionID;
3333
}
3434

35+
public String getSessionID()
36+
{
37+
return sessionID;
38+
}
39+
3540
/**
3641
* Restarts a playlist session. Given the session ID and a new set of
3742
* playlist parameters, this method restarts the playlist session based upon
@@ -79,7 +84,10 @@ public Playlist next(int results, int lookahead) throws EchoNestException {
7984
Map response = (Map) cresults.get("response");
8085

8186
String session = (String) response.get("session_id");
82-
87+
if (session == null)
88+
{
89+
session = sessionID;
90+
}
8391

8492
List<Song> songResults = new ArrayList<Song>();
8593

0 commit comments

Comments
 (0)