diff --git a/src/models/Track.js b/src/models/Track.js index dfb24e7..cadd197 100644 --- a/src/models/Track.js +++ b/src/models/Track.js @@ -54,7 +54,7 @@ class Track extends mongoose.Model { } isVisibleToPrivate(user) { - return user._id.equals(this.author._id); + return user && user._id.equals(this.author._id); } /**