add Bytes to check

This commit is contained in:
jim1_lin
2016-02-26 18:40:53 +08:00
committed by Jim Lin
parent dec95ca4fa
commit ae9f196ec7

View File

@@ -762,6 +762,11 @@ function getObjectType(obj) {
throw new Parse.Error(Parse.Error.INCORRECT_TYPE, JSON.stringify(obj) + " is not a valid GeoPoint");
}
break;
case 'Bytes' :
if(!obj.base64) {
throw new Parse.Error(Parse.Error.INCORRECT_TYPE, 'Bytes type has no base64 field: ' + JSON.stringify(obj));
}
break;
default :
throw new Parse.Error(Parse.Error.INCORRECT_TYPE, 'invalid type: ' + obj.__type);
}