Skip to content

Commit

Permalink
Check if fk is set
Browse files Browse the repository at this point in the history
  • Loading branch information
1602 committed Feb 1, 2016
1 parent de29292 commit 9972616
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/relations.js
Expand Up @@ -282,7 +282,7 @@ Model.belongsTo = function (anotherClass, params) {
this.prototype.__finders__ = this.prototype.__finders__ || {};

this.prototype.__finders__[methodName] = function (id) {
if (id === null) {
if (id === null || !this[fk]) {
return when.resolve(null);
}
var fk_ = this[fk].toString();
Expand Down

0 comments on commit 9972616

Please sign in to comment.