[13:21] <tbscope> I have a bug fix, but I'm not sure if it's the correct fix. I'll explain:<br>[13:21] <tbscope> I want to open a shoutcast playlist (pls file) but Amarok crashes<br>[13:21] <tbscope> Assert in some QList "index out of bounds"
<br>[13:22] <tbscope> I searched for the problem and found that at some point, the list with added tracks becomes empty<br>[13:22] <tbscope> The culprit is PlaylistModel.cpp ->    Model::insertOptioned<br>[13:22] <tbscope> In that function there's a check to see if the added track is a playlist
<br>[13:23] <tbscope> obviously it is<br>[13:23] <tbscope> so, the playlisthandler loads the playlist and takes (read: removes) the track from the list<br>[13:23] <tbscope> but the function continues<br>
[13:23] <tbscope> resulting in trying to add an empty list<br>[13:23] <tbscope> thus resulting in an out of bounds error somewhere later<br>[13:24] <hurra> tbscope: if noone responds here, write an email to the amarok mailinglist :)
<br>[13:24] <tbscope> Adding a check to see if the list becomes empty and returning from Model::insertOptioned seems to solve that problem<br>[13:24] <tbscope> hurra: thanks, I'll do that<br>[13:24] <nhnFreespirit> tbscope: we are talking Amarok2 here?
<br>[13:24] <tbscope> nhnFreespirit: yes, the version in trunk<br>[13:26] <nhnFreespirit> tbscope: hmmm... adding an empty list really should not cause a crash. If you send a patch to the mailing list I will have a look at it! :-)
<br><br>Patch:<br><br>Index: PlaylistModel.cpp<br>===================================================================<br>--- PlaylistModel.cpp   (revision 743903)<br>+++ PlaylistModel.cpp   (working copy)<br>@@ -509,6 +509,8 @@
<br>        }<br>    }<br><br>+   if (list.isEmpty())<br>+       return;<br><br>     int firstItemAdded = -1;<br>     if( options & Replace )<br><br><br>