Backport fix crash when list is empty
Backport fix crash when list is empty

svn path=/trunk/KDE/kdelibs/kate/; revision=481766

sandsmark/kate,hlamer/kate,sandsmark/kate,hlamer/kate,cmacq2/kate,cmacq2/kate,jfmcarreira/kate,hlamer/kate,DickJ/kate,jfmcarreira/kate,hlamer/kate,hlamer/kate,hlamer/kate,DickJ/kate,DickJ/kate,hlamer/kate,hlamer/kate,hlamer/kate,DickJ/kate,sandsmark/kate,jfmcarreira/kate,cmacq2/kate,hlamer/kate,sandsmark/kate