Fix error when check file type for javascript