Skip to content

Commit

Permalink
Fix possible class cast exception parsing folder id
Browse files Browse the repository at this point in the history
As per previous commit:
    commit 07eddf4

    Handle type-unsafe responses from LMS

    As we are not using customized parsers for our model objects, we simply
    parse incoming records to map. This parsing guess the type of the elements,
    so 2 becomes a Long, while "2" becomes a String.

    To handle this we check the type of the element in the map before using it.
  • Loading branch information
kaaholst committed Feb 5, 2024
1 parent 92113d3 commit e795017
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ public void downloadItem(JiveItem item) throws HandshakeNotCompleteException {

public Boolean randomPlayFolder(JiveItem item) {
SlimCommand command = item.randomPlayFolderCommand();
String folderID = (String) command.params.get("folder_id");
String folderID = Util.getString(command.params, "folder_id");
if (folderID == null) {
Log.e(TAG, "randomPlayFolder: No folder_id");
return false;
Expand Down

0 comments on commit e795017

Please sign in to comment.