fix: do not crash when not logged in

This commit is contained in:
Paul Bienkowski 2021-01-19 13:06:21 +01:00
parent 454803a062
commit 52231280db

View file

@ -54,7 +54,7 @@ class Track extends mongoose.Model {
} }
isVisibleToPrivate(user) { isVisibleToPrivate(user) {
return user._id.equals(this.author._id); return user && user._id.equals(this.author._id);
} }
/** /**