Skip to content

Commit

Permalink
Merge pull request #1480 from Seao/master
Browse files Browse the repository at this point in the history
Fix condition that use potential undefined variable and crash the application
  • Loading branch information
Tom Boutell authored Jul 10, 2018
2 parents eeb2691 + 9ce0c0b commit 0e8c703
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/modules/apostrophe-pieces-widgets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ module.exports = {
// whether the join has relationship properties or not.

self.pushPieceForWidget = function(widget, piece) {
if (self.joinById.relationship && (widget.by === 'id')) {
if (self.joinById && self.joinById.relationship && (widget.by === 'id')) {
widget._pieces.push({
item: piece,
relationship: (widget[self.joinById.relationshipsField] || {})[piece._id]
Expand Down

0 comments on commit 0e8c703

Please sign in to comment.