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 6e2c4f9 commit 3d7238bCopy full SHA for 3d7238b
lib/query.js
@@ -184,11 +184,17 @@
184
* @param {Object} options A Backbone-style options object.
185
*/
186
get: function(objectId, options) {
187
+ if(!objectId) {
188
+ var errorObject = new AV.Error(AV.Error.OBJECT_NOT_FOUND,
189
+ "Object not found.");
190
+ return AV.Promise.error(errorObject);
191
+ }
192
+
193
var self = this;
194
self.equalTo('objectId', objectId);
195
196
return self.first().then(function(response) {
- if (response) {
197
+ if (!AV._.isEmpty(response)) {
198
return response;
199
}
200
0 commit comments