Skip to content

Commit

Permalink
fix: additional check in Image Helper (#1611)
Browse files Browse the repository at this point in the history
  • Loading branch information
dziudek committed Aug 16, 2024
1 parent 3ac33de commit 3e1c308
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/back-end/helpers/image.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class ImageHelper {
let result = this.db.prepare('SELECT featured_image_id FROM posts WHERE id = @id').get({
id: this.postID
});

if (!result) {
return;
}

let featuredImageId = parseInt(result.featured_image_id, 10);

// Check if user removed image or image was empty
Expand Down

0 comments on commit 3e1c308

Please sign in to comment.