Skip to content

Commit

Permalink
Fix bug when deleting the last image
Browse files Browse the repository at this point in the history
  • Loading branch information
jwblangley committed Dec 25, 2019
1 parent e21190c commit 5464fa3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/mongoManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ async function saveUserContent(username, content) {
for (var i = 0; i < content.length; i++) {
content[i].orderIndex = i
}
await collection.insertMany(content)
if (content.length > 0) {
await collection.insertMany(content)
}
}

async function generateThumbnails(files, targetDirectory) {
Expand Down

0 comments on commit 5464fa3

Please sign in to comment.