Skip to content

Commit

Permalink
Make sure it's a string before trying to do indexOf
Browse files Browse the repository at this point in the history
  • Loading branch information
kopertop committed Mar 7, 2017
1 parent 8b36c89 commit a333c59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/file-upload/file-uploader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export class FileUploader {
Object.keys(this.options.additionalParameter).forEach((key:string) => {
let paramVal = this.options.additionalParameter[key];
// Allow an additional parameter to include the filename
if (paramVal.indexOf('{{file_name}}') >= 0) {
if (typeof paramVal === 'string' && paramVal.indexOf('{{file_name}}') >= 0) {
paramVal = paramVal.replace('{{file_name}}', item.file.name);
}
sendable.append(key, paramVal);
Expand Down

0 comments on commit a333c59

Please sign in to comment.