Page 1 of 1

Small fix to TranscodingService...

Posted: 12 Mar 2013, 15:28
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

Re: Small fix to TranscodingService...

Posted: 12 Mar 2013, 20:20
by Madsonic
thanks for spotting out this bug!

checked in your Fix into Madsonic!

best regards