Skip to content

Commit

Permalink
fix: handle invalid filenames when keepExtensions is true
Browse files Browse the repository at this point in the history
  • Loading branch information
GrosSacASac committed Feb 12, 2021
1 parent 22de063 commit d0a3484
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Formidable.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ class IncomingForm extends EventEmitter {
}

_getExtension(str) {
if (!str) {
return '';
}

const basename = path.basename(str);
const firstDot = basename.indexOf('.');
const lastDot = basename.lastIndexOf('.');
Expand Down

0 comments on commit d0a3484

Please sign in to comment.