Skip to content

Commit ce73a6e

Browse files
author
Ben
authored
Update ParseFile.js
1 parent 3fad3ae commit ce73a6e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/ParseFile.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,12 @@ export default class ParseFile {
102102
var commaIndex = data.base64.indexOf(',');
103103
try {
104104
window.atob(commaIndex === -1?data.base64:data.base64.slice(commaIndex + 1));
105-
return true;
106105
} catch(e) {
107106
throw new TypeError('Cannot create a Parse.File with that data.');
108107
}
109108

110109
if (commaIndex !== -1) {
111-
var matches = dataUriRegexp.slice(100).exec(data.base64);
110+
var matches = dataUriRegexp.exec(data.base64.slice(0, 100));
112111
// if data URI with type and charset, there will be 4 matches.
113112
this._source = {
114113
format: 'base64',

0 commit comments

Comments
 (0)