diff --git a/ExportAdapter.js b/ExportAdapter.js index df417ac83a..f12bb8384b 100644 --- a/ExportAdapter.js +++ b/ExportAdapter.js @@ -105,7 +105,7 @@ ExportAdapter.prototype.loadSchema = function(acceptor) { ExportAdapter.prototype.redirectClassNameForKey = function(className, key) { return this.loadSchema().then((schema) => { var t = schema.getExpectedType(className, key); - var match = t.match(/^relation<(.*)>$/); + var match = t ? t.match(/^relation<(.*)>$/) : false; if (match) { return match[1]; } else { diff --git a/spec/ParseRole.spec.js b/spec/ParseRole.spec.js index 44476f1bd2..57c54fceaa 100644 --- a/spec/ParseRole.spec.js +++ b/spec/ParseRole.spec.js @@ -58,5 +58,19 @@ describe('Parse Role testing', () => { }); + it('user role subscribers', (done)=> { + var role = new Parse.Role(); + role.set('name','subscribers'); + role.save({}, {useMasterKey : true}) + .then((x)=>{ + var query = role.relation('users').query(); + query.find({useMasterKey : true}) + .then((users)=>{ + done(); + }, (e)=>{ + fail('should not have errors'); + }); + }); + }) });