Fix JS error when the list of scripts to load is empty.