closed #2431: Potential crash when loading js files.