Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server/models/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ module.exports = class Storage extends Model {

static async pageEvent({ event, page }) {
try {
for (let target of this.targets) {
for (let target of (this.targets || [])) {
await target.fn[event](page)
}
} catch (err) {
Expand All @@ -190,7 +190,7 @@ module.exports = class Storage extends Model {

static async assetEvent({ event, asset }) {
try {
for (let target of this.targets) {
for (let target of (this.targets || [])) {
await target.fn[`asset${_.capitalize(event)}`](asset)
}
} catch (err) {
Expand All @@ -201,7 +201,7 @@ module.exports = class Storage extends Model {

static async getLocalLocations({ asset }) {
const locations = []
const promises = this.targets.map(async (target) => {
const promises = (this.targets || []).map(async (target) => {
try {
const path = await target.fn.getLocalLocation(asset)
locations.push({
Expand Down
2 changes: 1 addition & 1 deletion server/modules/storage/disk/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module.exports = {
id: currentPage.id,
title: _.get(pageData, 'title', currentPage.title),
description: _.get(pageData, 'description', currentPage.description) || '',
tags: newTags || currentPage.tags.map(t => t.tag),
tags: newTags || (currentPage.tags || []).map(t => t.tag),
isPublished: _.get(pageData, 'isPublished', currentPage.isPublished),
isPrivate: false,
content: pageData.content,
Expand Down