Skip to content

Commit d0a3484

Browse files
committed
fix: handle invalid filenames when keepExtensions is true
1 parent 22de063 commit d0a3484

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Formidable.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,10 @@ class IncomingForm extends EventEmitter {
480480
}
481481

482482
_getExtension(str) {
483+
if (!str) {
484+
return '';
485+
}
486+
483487
const basename = path.basename(str);
484488
const firstDot = basename.indexOf('.');
485489
const lastDot = basename.lastIndexOf('.');

0 commit comments

Comments
 (0)