JavaScript exception: Cannot call method 'charAt' of undefined (filelist.js) [#5829]

A fix for #5829.