Skip to content

Commit

Permalink
Merge pull request #48 from queenvictoria/master
Browse files Browse the repository at this point in the history
Prevent crash when attributeConfig is null or undefined.
  • Loading branch information
pmcnr-hx authored Sep 23, 2017
2 parents 87afc0b + dc82308 commit ab915aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongoHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ MongoStore.prototype._getSearchCriteria = function(request) {
var values = filter[attribute].map(MongoStore._filterElementToMongoExpr);
var attributeConfig = self.resourceConfig.attributes[attribute];
// Relationships need to be queried via .id
if (attributeConfig._settings) {
if (attributeConfig && attributeConfig._settings) {
attribute += ".id";
}
values = values.reduce(function(mongoExpressions, mongoExpr) {
Expand Down

0 comments on commit ab915aa

Please sign in to comment.