Fix bug to __type checking

This commit is contained in:
Jim Lin
2016-02-27 17:00:52 +08:00
parent 88b14a914a
commit f60c6af5e7

View File

@@ -741,9 +741,9 @@ function getObjectType(obj) {
}
break;
case 'File' :
if(obj.url && obj.name) {
if(obj.name) {
return 'file';
} else if(!obj.url){
} else {
let msg = obj.name? JSON.stringify(obj) + " is not a valid File" : "File has no name";
throw new Parse.Error(Parse.Error.INCORRECT_TYPE, msg);
}