Small fix to TranscodingService...

Need help? Post your questions here.
Otherland
Contributor
Contributor
Posts: 6
Joined: 07 Feb 2013, 11:44
Has thanked: 0
Been thanked: 3 times

Small fix to TranscodingService...

Unread post by Otherland »

Hi Madevil

In the method createTranscodeInputStream, there is the possibility to get NullPointerException, when there is now artist and/or album information and it's requested in the transcoding command.
It's the following few lines :

before:

Code: Select all

        if (title == null) {
            title = "Unknown Song";
        }
        if (album == null) {
            title = "Unknown Album";
        }
        if (artist == null) {
            title = "Unknown Artist";
        }
after:

Code: Select all

        if (title == null) {
            title = "Unknown Song";
        }
        if (album == null) {
            album = "Unknown Album";
        }
        if (artist == null) {
            artist = "Unknown Artist";
        }
The info gets used here which will result in the NullPointerExcepsions

Code: Select all

            if (cmd.contains("%l")) {
                cmd = cmd.replace("%l", album);
            }
            if (cmd.contains("%a")) {
                cmd = cmd.replace("%a", artist);
            }
It's an older error as it also exists in subsonic....

/Otherland
User avatar
Madsonic
Administrator
Administrator
Posts: 984
Joined: 07 Dec 2012, 03:58
Answers: 7
Has thanked: 1201 times
Been thanked: 470 times

Re: Small fix to TranscodingService...

Unread post by Madsonic »

thanks for spotting out this bug!

checked in your Fix into Madsonic!

best regards
Post Reply