Fixed issue with SQL error when session.fileids list is empty