We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 722faed commit 9f2ec36Copy full SHA for 9f2ec36
src/file.js
@@ -16,6 +16,7 @@ module.exports = function(AV) {
16
// port from browserify path module
17
// since react-native packager won't shim node modules.
18
const extname = (path) => {
19
+ if (!_.isString(path)) return '';
20
return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
21
};
22
@@ -127,7 +128,7 @@ module.exports = function(AV) {
127
128
}
129
130
if (!process.env.CLIENT_PLATFORM) {
- if (data instanceof require('stream')) {
131
+ if (data instanceof require('stream') && data.path) {
132
this._extName = extname(data.path);
133
134
if (Buffer.isBuffer(data)) {
0 commit comments